diff --git a/api_v2/migrations/0004_alter_rule_index_alter_rule_initialheaderlevel_and_more.py b/api_v2/migrations/0004_alter_rule_index_alter_rule_initialheaderlevel_and_more.py new file mode 100644 index 00000000..5676b3ac --- /dev/null +++ b/api_v2/migrations/0004_alter_rule_index_alter_rule_initialheaderlevel_and_more.py @@ -0,0 +1,29 @@ +# Generated by Django 5.1.1 on 2024-10-08 21:49 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api_v2', '0003_rename_rulegroup_ruleset'), + ] + + operations = [ + migrations.AlterField( + model_name='rule', + name='index', + field=models.IntegerField(default=1, help_text="A rule's position in the list of rules of the parent RuleSet"), + ), + migrations.AlterField( + model_name='rule', + name='initialHeaderLevel', + field=models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)], default=1, help_text='The header level to set rule title to'), + ), + migrations.AlterField( + model_name='rule', + name='ruleset', + field=models.ForeignKey(help_text='The RuleSet which this Rule belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='rules', to='api_v2.ruleset'), + ), + ] diff --git a/api_v2/models/rules.py b/api_v2/models/rules.py index dc1fb406..6c9703e0 100644 --- a/api_v2/models/rules.py +++ b/api_v2/models/rules.py @@ -15,15 +15,23 @@ class Rule(HasName, HasDescription, FromDocument): The Rule model contains information about a single rule from a larger RuleGroup. Each Rule is typically a paragraph or two long and might contain tables. """ + key = key_field() - index = models.IntegerField(default=1) + + index = models.IntegerField( + default=1, + help_text="A rule's position in the list of rules of the parent RuleSet" + ) + ruleset = models.ForeignKey( RuleSet, on_delete=models.CASCADE, - related_name='rules' + related_name='rules', + help_text="The RuleSet which this Rule belongs to" ) initialHeaderLevel = models.IntegerField( default=1, - choices=((i, i) for i in range(1,6)) + choices=((i, i) for i in range(1,6)), + help_text="The header level to set rule title to" ) \ No newline at end of file