diff options
Diffstat (limited to 'ishtar_common/forms.py')
-rw-r--r-- | ishtar_common/forms.py | 8 |
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): |