views:

17

answers:

0

We have a bunch of formsets:

EmailAddressInlineFormSet = generic_inlineformset_factory(
    EmailAddress, extra=1,
    exclude=["created_by","last_modified_by"])
emailaddressformset = EmailAddressInlineFormSet(
    instance=person,
    prefix="emailaddress")

# [ more definitions ]

and, in the view, we process them as:

emailaddressformset = EmailAddressInlineFormSet(
    request.POST,
    instance=person,
    prefix="emailaddress")

# [ more definitions ]

So, nothing fancy or unordinary.

The unfortunate or unordinary fact is, we have 15 of these formsets, one for email addresses, other for phone numbers etc. so the view code is ugly and not-so-manageable. What would be the most unhackish way to handle this number of formsets in a single view?

At the end -i guess- I'm looking for a class or a functionality like multiple_generic_inline_formset and open to all kind of suggestions or discussions.