diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 14:02:54 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 14:03:59 +0100 |
commit | ae4023fee02cd69fa724f03fd12dc0a7dee2e42b (patch) | |
tree | 217544dc8314465e48ac88f8cd8b7fbacd180909 /ctrack/caf | |
parent | 0a55f8e5b0cfc0e5a9a1babac7a03a38c49379ea (diff) |
updated field names on NIS system add page
Diffstat (limited to 'ctrack/caf')
-rw-r--r-- | ctrack/caf/forms.py | 25 | ||||
-rw-r--r-- | ctrack/caf/migrations/0007_auto_20200814_1230.py | 23 | ||||
-rw-r--r-- | ctrack/caf/models.py | 6 |
3 files changed, 48 insertions, 6 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py index 61d03b4..594a162 100644 --- a/ctrack/caf/forms.py +++ b/ctrack/caf/forms.py @@ -29,6 +29,10 @@ class ApplicableSystemCreateFromCafForm(forms.Form): choices=ApplicableSystem.SYSTEM_CATEGORISATION, help_text="Refer to documentation for description of these criteria", ) + oes_categorisation = forms.CharField( + max_length=255, + help_text="Categorisation based on OES' own internal prioritisation process.", + ) def __init__(self, *args, **kwargs): # We must pop the kwargs before we pass to super() @@ -39,6 +43,8 @@ class ApplicableSystemCreateFromCafForm(forms.Form): caf = CAF.objects.get(pk=caf_id) cancel_redirect = reverse("caf:detail", args=[caf_id]) self.fields["caf"].queryset = CAF.objects.filter(pk=caf_id) + self.fields["dft_categorisation"].label = "DfT Categorisation" + self.fields["oes_categorisation"].label = "OES Categorisation" self.helper = FormHelper(self) self.helper.layout = Layout( Fieldset( @@ -46,6 +52,7 @@ class ApplicableSystemCreateFromCafForm(forms.Form): Field("name", css_class="form-control-lg"), "function", "dft_categorisation", + "oes_categorisation", Hidden("caf", caf_id), Hidden("organisation", org_id), ), @@ -60,18 +67,20 @@ class ApplicableSystemCreateFromCafForm(forms.Form): ), ) - class Meta: - model = ApplicableSystem - labels = { - "dft_categorisation": "DFT CATEGORISATION", - } - class ApplicableSystemCreateFromOrgForm(forms.Form): name = forms.CharField(max_length=255) function = forms.CharField(widget=forms.Textarea) organisation = forms.ModelChoiceField(queryset=Organisation.objects.all()) caf = forms.ModelChoiceField(queryset=CAF.objects.all()) + dft_categorisation = forms.ChoiceField( + choices=ApplicableSystem.SYSTEM_CATEGORISATION, + help_text="Refer to documentation for description of these criteria", + ) + oes_categorisation = forms.CharField( + max_length=255, + help_text="Categorisation based on OES' own internal prioritisation process.", + ) def __init__(self, org_id, slug, org_name, org_cafs, *args, **kwargs): super().__init__(*args, **kwargs) @@ -80,12 +89,16 @@ class ApplicableSystemCreateFromOrgForm(forms.Form): self.fields["caf"].queryset = CAF.objects.filter( pk__in=[caf.pk for caf in org_cafs] ) + self.fields["dft_categorisation"].label = "DfT Categorisation" + self.fields["oes_categorisation"].label = "OES Categorisation" self.helper = FormHelper(self) self.helper.layout = Layout( Fieldset( "", Field("name", css_class="form-control-lg"), "function", + "dft_categorisation", + "oes_categorisation", Hidden("organisation", org_id), "caf", ), diff --git a/ctrack/caf/migrations/0007_auto_20200814_1230.py b/ctrack/caf/migrations/0007_auto_20200814_1230.py new file mode 100644 index 0000000..68a12bd --- /dev/null +++ b/ctrack/caf/migrations/0007_auto_20200814_1230.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.12 on 2020-08-14 12:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('caf', '0006_auto_20200813_1125'), + ] + + operations = [ + migrations.AddField( + model_name='applicablesystem', + name='oes_categorisation', + field=models.CharField(default='', help_text="Categorisation based on OES' own internal prioritisation process.", max_length=255, verbose_name='OES Categorisation'), + ), + migrations.AlterField( + model_name='applicablesystem', + name='dft_categorisation', + field=models.CharField(choices=[('CR', 'Critical'), ('IM', 'Important (Legacy use only)')], default='CR', help_text='Refer to documentation for description of these criteria', max_length=2, verbose_name='DfT Categorisation'), + ), + ] diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py index e00a8d0..b7314f9 100644 --- a/ctrack/caf/models.py +++ b/ctrack/caf/models.py @@ -85,6 +85,12 @@ class ApplicableSystem(models.Model): verbose_name="DfT Categorisation", help_text="Refer to documentation for description of these criteria", ) + oes_categorisation = models.CharField( + max_length=255, + default="NA", + verbose_name="OES Categorisation", + help_text="Categorisation based on OES' own internal prioritisation process.", + ) class Meta: verbose_name = "NIS System" |