Adam Kelly wrote: > In the view: > rows = zip( *[ ( thing.name, thing.color, thing.weight ) for thing in > object_list ] ) > > In the template: > {% for row in rows %} > <tr> > {% for item in row %} > <td>{{item}}</td> > {% endfor %} > </tr> > {% endfor %}
To generalize this a bit more, you could do: rows = zip(*[[getattr(thing, field.name) for field in Thing._meta.fields] for thing in Thing.objects.all()]) --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---