You can pass a prefix parameter when constructing the formsets (not
the formset classes):
Formset1 = inlineformset_factory(Parent, Child1)
Formset2 = inlineformset_factory(Parent, Child2)
if request.method == 'POST':
child1_formset = Formset1(request.POST, ..., prefix='child1')
child2_formset = Formset2(request.POST, ..., prefix='child2')
else:
child1_formset = Formset1(..., prefix='child1')
child2_formset = Formset2(..., prefix='child2')
This prefix will be added to all formset fields automatically. The
browser and Django will be able to differentiate between the two
formsets now.
Matthias
I presume you mean more than two forms of the same type (Child1 or
Child2)? That's easily possible, and we use it all the time. Take a
look at the max_num and extra parameters to the factory function.
Matthias
--
FeinCMS Django CMS building toolkit: http://spinlock.ch/pub/feincms/
Well, you can easily show the input fields from Formset1 and Formset2
intertwined. You need to output the mangement forms and the individual
fields by hand. It's very similar to outputting form elements by hand
instead of using the as_ul/as_table convenience methods.
Hope it helps,