diff --git a/api_v2/migrations/0019_damagetype.py b/api_v2/migrations/0019_damagetype.py new file mode 100644 index 00000000..077076f3 --- /dev/null +++ b/api_v2/migrations/0019_damagetype.py @@ -0,0 +1,26 @@ +# Generated by Django 3.2.20 on 2023-11-04 18:25 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api_v2', '0018_merge_0013_creature_type_0017_auto_20231006_1953'), + ] + + operations = [ + migrations.CreateModel( + name='DamageType', + 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)), + ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api_v2.document')), + ], + options={ + 'verbose_name_plural': 'damage types', + }, + ), + ] diff --git a/api_v2/views/__init__.py b/api_v2/views/__init__.py index 67d2b037..b78e1c73 100644 --- a/api_v2/views/__init__.py +++ b/api_v2/views/__init__.py @@ -19,3 +19,4 @@ from .item import ArmorFilterSet, ArmorViewSet from .item import WeaponFilterSet, WeaponViewSet +from .damagetype import DamageTypeViewSet \ No newline at end of file diff --git a/api_v2/views/damagetype.py b/api_v2/views/damagetype.py index 78ace654..13737687 100644 --- a/api_v2/views/damagetype.py +++ b/api_v2/views/damagetype.py @@ -4,7 +4,7 @@ from api_v2 import serializers -class FeatViewSet(viewsets.ReadOnlyModelViewSet): +class DamageTypeViewSet(viewsets.ReadOnlyModelViewSet): """ list: API endpoint for returning a list of damage types. retrieve: API endpoint for returning a particular damage type. diff --git a/server/urls.py b/server/urls.py index 8312c2de..32e55f6d 100644 --- a/server/urls.py +++ b/server/urls.py @@ -65,6 +65,7 @@ router_v2.register(r'races',views_v2.RaceViewSet) router_v2.register(r'creatures',views_v2.CreatureViewSet) router_v2.register(r'creaturetype',views_v2.CreatureTypeViewSet) + router_v2.register(r'damagetype',views_v2.DamageTypeViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API.