From 37a623920e40443675cb2fce41ecb2723f9d0872 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 28 Oct 2023 07:08:25 -0500 Subject: [PATCH] Adding CreatureSet to DB and UI --- api_v2/admin.py | 7 +++++++ api_v2/migrations/0010_creatureset.py | 28 +++++++++++++++++++++++++++ api_v2/models/__init__.py | 1 + 3 files changed, 36 insertions(+) create mode 100644 api_v2/migrations/0010_creatureset.py diff --git a/api_v2/admin.py b/api_v2/admin.py index 0a03dd95..fb51ebe2 100644 --- a/api_v2/admin.py +++ b/api_v2/admin.py @@ -43,7 +43,14 @@ class FeatAdmin(admin.ModelAdmin): admin.site.register(Feat, admin_class=FeatAdmin) +admin.site.register(Creature) +admin.site.register(CreatureAction) +admin.site.register(CreatureAttack) +admin.site.register(CreatureSet) + + admin.site.register(Document) admin.site.register(License) admin.site.register(Publisher) admin.site.register(Ruleset) + diff --git a/api_v2/migrations/0010_creatureset.py b/api_v2/migrations/0010_creatureset.py new file mode 100644 index 00000000..e53d65dd --- /dev/null +++ b/api_v2/migrations/0010_creatureset.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.20 on 2023-10-28 12:07 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api_v2', '0009_alter_creatureaction_options'), + ] + + operations = [ + migrations.CreateModel( + name='CreatureSet', + fields=[ + ('name', models.CharField(help_text='Name of the item.', max_length=100)), + ('desc', models.TextField(help_text='Description of the game content item. Markdown.')), + ('key', models.CharField(help_text='Unique key for the Item.', max_length=100, primary_key=True, serialize=False)), + ('type', models.TextField(choices=[('MONSTER_TYPE', 'Monster Type')])), + ('creatures', models.ManyToManyField(help_text='The set of creatures.', related_name='creaturesets', to='api_v2.Creature')), + ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api_v2.document')), + ], + options={ + 'abstract': False, + }, + ), + ] diff --git a/api_v2/models/__init__.py b/api_v2/models/__init__.py index 80a71526..ed9b9a25 100644 --- a/api_v2/models/__init__.py +++ b/api_v2/models/__init__.py @@ -17,6 +17,7 @@ from .creature import Creature from .creature import CreatureAction from .creature import CreatureAttack +from .creature import CreatureSet from .document import Document from .document import License