aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/forms.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/caf/forms.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py
index fac3049..5903a2c 100644
--- a/ctrack/caf/forms.py
+++ b/ctrack/caf/forms.py
@@ -18,3 +18,26 @@ from django.forms.models import ModelMultipleChoiceField
CAFCreateInlineFormset = inlineformset_factory(
CAF, ApplicableSystem, fields=("name", "organisation"), extra=2)
+
+
+class ApplicableSystemCreateForm(forms.ModelForm):
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.helper = FormHelper(self)
+ self.helper.layout = Layout(
+ Fieldset(
+ "Create a new System",
+ "name",
+ "description",
+ "organisation",
+ "caf",
+ ),
+ ButtonHolder(
+ Submit("submit", "Submit", css_class="btn-primary")
+ )
+ )
+
+ class Meta:
+ model = ApplicableSystem
+ fields = ["name", "description", "organisation", "caf"]