1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from django.forms.formsets import formset_factory
def dynamic_formset(formset, extra=None, can_order=None, can_delete=None, max_num=None):
if extra is None:
extra = formset.extra
if can_order is None:
can_order = formset.can_order
if can_delete is None:
can_delete = formset.can_delete
if max_num is None:
max_num = formset.max_num
return formset_factory(form = formset.form,
formset = formset.__class__,
extra = extra,
can_order = can_order,
can_delete = can_delete,
max_num = max_num)
|
More like this
- Arbitrary length formset by Rupe 3 years, 9 months ago
- Complex Formsets, Redux by smagala 3 years, 3 months ago
- Form and FormSet that are defined dynamically with request-data by Lacour 3 years, 5 months ago
- Dynamical formsets by I159 1 year, 7 months ago
- FieldAccessForm (per-field user access for forms derived from models) by Killarny 4 years, 8 months ago
Comments