Add case collection update functionality with form handling and template (move from CaseCollection form)

This commit is contained in:
Ross
2025-08-04 12:21:37 +01:00
parent c33e8c0240
commit 0af6b25349
6 changed files with 161 additions and 17 deletions
+18 -1
View File
@@ -992,4 +992,21 @@ class CaseDisplaySetForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Optionally, you can filter queryset for findings/structures/conditions here if needed
# Optionally, you can filter queryset for findings/structures/conditions here if needed
class CaseCollectionUpdateCaseForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
self.collection = kwargs.pop("collection", None)
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_id = "id-case-form"
self.helper.form_class = "case-form"
self.helper.form_method = "post"
self.helper.form_action = "submit"
self.helper.form_tag = False
self.helper.layout = Layout()
class Meta:
model = CaseCollection
fields = [] # No fields, just for compatibility with UpdateView