Skip to content

Commit

Permalink
Adding into views, urls and tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Nov 4, 2023
1 parent 4d1b1d5 commit 1cb71ee
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions api_v2/migrations/0019_damagetype.py
Original file line number Diff line number Diff line change
@@ -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',
},
),
]
1 change: 1 addition & 0 deletions api_v2/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
from .item import ArmorFilterSet, ArmorViewSet
from .item import WeaponFilterSet, WeaponViewSet

from .damagetype import DamageTypeViewSet
2 changes: 1 addition & 1 deletion api_v2/views/damagetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions server/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1cb71ee

Please sign in to comment.