Add case collection update functionality with form handling and template (move from CaseCollection form)
This commit is contained in:
+18
-1
@@ -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
|
||||
Reference in New Issue
Block a user