Skip to content

Commit

Permalink
Adding CreatureSet to DB and UI
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Oct 28, 2023
1 parent 87afa04 commit 37a6239
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api_v2/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

28 changes: 28 additions & 0 deletions api_v2/migrations/0010_creatureset.py
Original file line number Diff line number Diff line change
@@ -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,
},
),
]
1 change: 1 addition & 0 deletions api_v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37a6239

Please sign in to comment.