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 %}
  {{ group.grouper }}
  {% for form in group %}
    {{ form }}
{# ... #}

While this doesn't throw an error, it doesn't really work, either (instead of 
grouping by the attribute, django attempts to group by the attribute widget, 
which is, while logical, not the aim).

My question is this: Is using regroup as shown above a viable solution for the 
given problem at all? If so, how would you access the objects attributes? If 
not, is there an clean alternative? What would you suggest? (I have thought 
about multiple formsets, for example, or regrouping the objects themselves and 
'faking' a formset in html in the template, but both of these are not really 
nice solutions)

I'd be very grateful for any hints on how to solve this -- your help is much 
appreciated.

Thanks!


-Felix
___________________________________________________________
WEB.DE DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für 
nur 19,99 €/mtl.!* http://web.de/DSL-Doppel-Flatrate/

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

Reply via email to