Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api_v2/migrations/0079_rename_creatureaction_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api_v2', '0078_merge_staging_and_crossreference_chains'),
]

operations = [
migrations.RenameField(
model_name='creatureaction',
old_name='order',
new_name='order_in_statblock',
),
migrations.RenameField(
model_name='creatureaction',
old_name='form_condition',
new_name='limited_to_form',
),
migrations.RenameField(
model_name='creatureaction',
old_name='legendary_cost',
new_name='legendary_action_cost',
),
]
6 changes: 3 additions & 3 deletions api_v2/models/creature.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,21 +244,21 @@ class CreatureAction(HasName, HasDescription):
help_text='The type of action used.'
)

order = models.SmallIntegerField(
order_in_statblock = models.SmallIntegerField(
blank=True,
null=True,
help_text='The position in the list of features that a feature appears in its source statblock'
)

form_condition = models.CharField(
limited_to_form = models.CharField(
blank=True,
null=True,
default=None,
max_length=100,
help_text='Description of form-based conditions for this action.'
)

legendary_cost = models.SmallIntegerField(
legendary_action_cost = models.SmallIntegerField(
blank=True,
null=True,
default=None,
Expand Down
5 changes: 0 additions & 5 deletions api_v2/serializers/creature.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ def get_distance_unit(self, CreatureActionAttack):
class CreatureActionSerializer(GameContentSerializer):
attacks = CreatureActionAttackSerializer(many=True, read_only=True)
usage_limits = serializers.SerializerMethodField()

# rename model fields to improve readibility of JSON
order_in_statblock = serializers.IntegerField(source='order')
limited_to_form = serializers.CharField(source='form_condition')
legendary_action_cost = serializers.IntegerField(source='legendary_cost')

class Meta:
model = models.CreatureAction
Expand Down
Loading