I have a problem with needing to provide multiple model backed forms on the same page. I understand how to do this with single forms, i.e. just create both the forms call them something different then use the appropriate names in the template.
Now how exactly do you expand that solution to work with modelformsets? The wrinkle, of course, is that each 'form' must be rendered together in the appropriate fieldset.
For example I want my template to produce something like this:
Home Base Description: Want ice cream? Home Base Description: Want ice cream?I am using a loop like this to process the results (after form validation)
base_models = base_formset.save(commit=False)
like_models = like_formset.save(commit=False)
for base_model, likes_model in map(None, base_models, likes_models):
which works as I'd expect (I'm using map because the # of forms can be different). The problem is that I can't figure out a way to do the same thing with the templating engine. The system does work if I layout all the base models together then all the likes models after wards, but it doesn't meet the layout requirements.
EDIT: Updated the problem statement to be more clear about what exactly I'm processing (I'm processing models not forms in the for loop)