Skip to content
Helper class to handle form composition
Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
composite_form
example
templates/bin
.gitignore
README.rst
bootstrap.py
buildout.cfg
setup.cfg
setup.py

README.rst

Usage:

class ProfileAddressForm(forms.Form):
    address = forms.CharField()


class ProfileBirthDayForm(forms.Form):
    birthday = forms.DateField()


class ProfileForm(CompositeForm):
    form_list = [ProfileAddressForm, ProfileBirthDayForm]


profile_form = ProfileForm({"address": "13 Test St"})
assert profile_form.errors == {'birthday': [u'This field is required.']}
Something went wrong with that request. Please try again.