aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/forms.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/caf/forms.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py
index 928686d..412d310 100644
--- a/ctrack/caf/forms.py
+++ b/ctrack/caf/forms.py
@@ -12,7 +12,7 @@ from django import forms
from django.forms import inlineformset_factory
from django.urls import reverse
-from ctrack.caf.models import CAF, ApplicableSystem
+from ctrack.caf.models import CAF, ApplicableSystem, EssentialService
from ctrack.organisations.models import Organisation
# TODO - Replace this to get inlineformet working
@@ -78,13 +78,14 @@ class ApplicableSystemCreateFromCafForm(forms.Form):
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())
- essential_service = forms.CharField(
- widget=forms.Textarea,
- max_length=255,
- help_text="Description of the essential service which the system suppports.",
- )
+ # organisation = forms.ModelChoiceField(queryset=Organisation.objects.all())
+ # caf = forms.ModelChoiceField(queryset=CAF.objects.all())
+ # essential_service = forms.CharField(
+ # widget=forms.Textarea,
+ # max_length=255,
+ # help_text="Description of the essential service which the system suppports.",
+ # )
+ essential_service = forms.ModelChoiceField(queryset=EssentialService.objects.all())
dft_categorisation = forms.ChoiceField(
choices=ApplicableSystem.SYSTEM_CATEGORISATION,
help_text="Refer to documentation for description of these criteria",
@@ -94,14 +95,14 @@ class ApplicableSystemCreateFromOrgForm(forms.Form):
help_text="Categorisation based on OES' own internal prioritisation process.",
)
- def __init__(self, org_id, slug, org_name, org_cafs, *args, **kwargs):
+ def __init__(self, org_id, slug, org_name, *args, **kwargs):
super().__init__(*args, **kwargs)
cancel_redirect = reverse("organisations:detail", args=[slug])
# we need to create the choices we can use for the CAF dropdown in the form
- self.fields["caf"].queryset = CAF.objects.filter(
- pk__in=[caf.pk for caf in org_cafs]
- )
- self.fields["caf"].label = "CAF"
+ # self.fields["caf"].queryset = CAF.objects.filter(
+ # pk__in=[caf.pk for caf in org_cafs]
+ # )
+ # self.fields["caf"].label = "CAF"
self.fields["dft_categorisation"].label = "DfT Categorisation"
self.fields["oes_categorisation"].label = "OES Categorisation"
self.helper = FormHelper(self)
@@ -114,7 +115,6 @@ class ApplicableSystemCreateFromOrgForm(forms.Form):
"dft_categorisation",
"oes_categorisation",
Hidden("organisation", org_id),
- "caf",
),
ButtonHolder(
Submit("submit", "Submit", css_class="btn-primary"),