|
@ -81,10 +81,15 @@ class CrispyLayoutFormMixin(object): |
|
|
for fieldname, span in row] |
|
|
for fieldname, span in row] |
|
|
|
|
|
|
|
|
def get_form(self, form_class=None): |
|
|
def get_form(self, form_class=None): |
|
|
form = super(CrispyLayoutFormMixin, self).get_form(form_class) |
|
|
try: |
|
|
form.helper = FormHelper() |
|
|
form = super(CrispyLayoutFormMixin, self).get_form(form_class) |
|
|
form.helper.layout = SaplFormLayout(*self.get_layout()) |
|
|
except AttributeError: |
|
|
return form |
|
|
# simply return None if there is no get_form on super |
|
|
|
|
|
pass |
|
|
|
|
|
else: |
|
|
|
|
|
form.helper = FormHelper() |
|
|
|
|
|
form.helper.layout = SaplFormLayout(*self.get_layout()) |
|
|
|
|
|
return form |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def list_field_names(self): |
|
|
def list_field_names(self): |
|
|