Re: Regrouping forms in formsets

2010-09-04 Thread Felix H.
Hi! I just figured this one out and would like to share my solution for posterity: Since the formset in question is a ModelFormSet (which I forgot to mention in the above message, sorry!), the data for each form can be accessed using "form.instance". Thus, the regroup tag should read: {% regroup

Regrouping forms in formsets

2010-09-03 Thread Felix H.
Hi! I'd like to structure a formset of a given model by an attribute of the model, just as the regroup template tag would do. Therefore, I tried to apply regroup as one would outside a formset: {% regroup formset.forms by attribute as forms_by_attribute %} {% for group in forms_by_attribute %}