Skip to content

Commit

Permalink
Adding fields to SpellCastingOption.
Browse files Browse the repository at this point in the history
  • Loading branch information
augustjohnson committed Oct 22, 2024
1 parent 730a662 commit c33c12d
Show file tree
Hide file tree
Showing 10 changed files with 16,799 additions and 5,589 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 5.1.2 on 2024-10-22 13:58

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api_v2', '0009_merge_20241010_0144'),
]

operations = [
migrations.AddField(
model_name='spellcastingoption',
name='concentration',
field=models.BooleanField(blank=True, default=False, help_text='Whether the effect requires concentration to be maintained.', null=True),
),
migrations.AddField(
model_name='spellcastingoption',
name='shape_size',
field=models.FloatField(blank=True, help_text='Used to measure distance.', null=True, validators=[django.core.validators.MinValueValidator(0)]),
),
]
12 changes: 11 additions & 1 deletion api_v2/models/spell.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def search_result_extra_fields(self):
"school": self.school.name,
"level": self.level,
}



class SpellCastingOption(models.Model):
"""An object representing an alternative way to cast a spell."""

Expand All @@ -179,3 +180,12 @@ class SpellCastingOption(models.Model):
range = models.TextField(
null=True, # Null values mean this value is unchanged from the default casting option.
help_text='Description of the range of the spell.')

concentration = models.BooleanField(
null=True, # Null values mean this value is unchanged from the default casting option.
blank=True,
help_text='Whether the effect requires concentration to be maintained.',
default=False)

shape_size = distance_field()
# Null values mean this value is unchanged from the default casting option.
Loading

0 comments on commit c33c12d

Please sign in to comment.