Skip to content

Commit

Permalink
added help_text to rules models
Browse files Browse the repository at this point in the history
  • Loading branch information
calumbell committed Oct 8, 2024
1 parent 1c67f12 commit 0540833
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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'),
),
]
14 changes: 11 additions & 3 deletions api_v2/models/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

0 comments on commit 0540833

Please sign in to comment.