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
commit6c57e2b6974a7acffff684279ab2c2b74edd1676 (patch)
tree67d308063f0c78cbf26e3b040821e762fed5b4e3 /ishtar_common/forms.py
parent674eeafec7e973bf0d0fe24ada9866d346fd34cf (diff)
downloadIshtar-6c57e2b6974a7acffff684279ab2c2b74edd1676.tar.bz2
Ishtar-6c57e2b6974a7acffff684279ab2c2b74edd1676.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):