Greetings I'm trying to render the spending of members of a parliament as part of their information pages.
The expenses are stored as rows in a model called Expense, so right now I can show a horizontal table with the Year on the Y axis with this: {% for expenserow in member.person_id.expense_set.all %} <tr class="{% cycle 'row-1' 'row-2' %}"> <td>{{ expenserow.year|date:"Y" }}</td> <td>€{{ expenserow.salary|floatformat:2|intcomma }}</td> <td>€{{ expenserow.travel|floatformat:2|intcomma }}</td> <td>€{{ expenserow.mobile|floatformat:2|intcomma }}</td> <td>€{{ expenserow.mea|floatformat:2|intcomma }}</td> <td>€{{ expenserow.office|floatformat:2|intcomma }}</td> <td>€{{ expenserow.officegrant|floatformat:2|intcomma }}</td> <td>€{{ expenserow.consphone|floatformat:2|intcomma }}</td> <td>€{{ expenserow.cta|floatformat:2|intcomma }}</td> <td>€{{ expenserow.isdn|floatformat:2|intcomma }}</td> <td>€{{ expenserow.allowance|floatformat:2|intcomma }}</td> <td>€{{ expenserow.ssa|floatformat:2|intcomma }}</td> <td>€{{ expenserow.committeetravel|floatformat:2|intcomma }}</td> <td>€{{ expenserow.cttee_ent|floatformat:2|intcomma }}</td> <td>€{{ expenserow.bpa|floatformat:2|intcomma }}</td> <td>€{{ expenserow.ipu|floatformat:2|intcomma }}</td> </tr> {% endfor %} My problem, and question: how on earth can I instead spit this data out with years as the column headers and the categories as rows, instead? There are far more categories of data than there are years of data, and what I have now simply won't fit into the horizontal space of the average browser window. Tips (which don't involve creating a dozen new semantically-much-less-meaningful models) gratefully received... Thanks John Handelaar -- 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.