django-formfieldset is a simple Django app that provides a mix-in class for admin-like fieldset rendering.
- Fieldset functionality similar to
ModelAdmin
- Shorthand rendering functions with fieldsets
- as
P
- as
TABLE
- as
UL
- as
- Overrides nothing in
django.forms.Form
- Add 'django-formfieldset' directory to your Python path.
- Add 'formfieldset' to your
INSTALLED_APPS
tuple found in your settings file. (optional - to be able to run tests) - Create your forms with
FieldsetMixin
- Add a
fieldsets
attribute to your form. See admin docs for detailed explanation. - Render your form with fieldset enabled methods:
- You can use
iter_fieldsets()
for custom form rendering. It will yieldFieldset
objects.Fieldset
s act as iterators for widgets in them. - You can use
as_fieldset_table()
,as_fieldset_ul()
andas_fieldset_p()
methods that act like built-inas_*
method except fieldset support.
- You can use