Sunday, May 22, 2011

Multiple formsets in a view

Hello,

in my view, I create dinamically multiple formsets, and I put a
dinamic prefix to all of them (ex, formset1, formset2, ...), then I
pack all the formsets in a list and pass it to the template.

Later, how I can retrieve all the formsets from request.POST? I know
that I've to do something like this:

formset = formset_factory(myFormset, prefix='myprefix')

there's a way to iterate over all the formsets of request.POST, and
get the prefix of them?

Or the only way to do this is to pass a hidden field to the form
containing the number of formsets, and then in the POST, check it and
use that number as the variable part of the prefix?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate