summaryrefslogtreecommitdiff
path: root/ishtar_common/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-04-17 12:04:08 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-06-12 08:41:54 +0200
commit0666e34337b965e85ce3920363ad04e87958e8e7 (patch)
tree67d308063f0c78cbf26e3b040821e762fed5b4e3 /ishtar_common/forms.py
parent022d362b707f0396461a1b32f001baab96a885fc (diff)
downloadIshtar-0666e34337b965e85ce3920363ad04e87958e8e7.tar.bz2
Ishtar-0666e34337b965e85ce3920363ad04e87958e8e7.zip
WIP on account wizard. Wizard: can use switch for deletion. Better display of formsets on done wizard.
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r--ishtar_common/forms.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index 70e144980..c314e4f13 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -193,6 +193,8 @@ class CustomForm(object):
class FormSet(CustomForm, BaseFormSet):
+ delete_widget = widgets.DeleteWidget
+
def __init__(self, *args, **kwargs):
self.readonly = False
if 'readonly' in kwargs:
@@ -240,7 +242,11 @@ class FormSet(CustomForm, BaseFormSet):
setattr(form, clean.__name__, types.MethodType(clean, form))
if self.can_delete:
form.fields[DELETION_FIELD_NAME].label = ''
- form.fields[DELETION_FIELD_NAME].widget = widgets.DeleteWidget()
+ form.fields[DELETION_FIELD_NAME].widget = self.delete_widget()
+
+
+class FormSetWithDeleteSwitches(FormSet):
+ delete_widget = widgets.DeleteSwitchWidget
class FieldType(object):