On Nov 1, 9:56 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have this code in my view, for example:
>
> a=['a','b','c'] # a list of row labels
> b=[1,2,3] # a list of col label
> c=tab # an array (list of list) with len(a) rows and len(b) cols.
If c[i, j] previously had a value of x, change it to have a tuple of
the form:
c[i, j] = (x, a[i], b[j])
Thus, each c element now has its own value as well as its 'a' and 'b'
labels.
> then on the template side, it's easy to print c
> {% for row in c %}
> <tr>
> {% for col in row %}
> <td>{{ col }}</td>
> {% endfor %}
> </tr>
> {% endfor %}
Change: <td>{{ col }}</td> to
<td>{{ col.0 }}, {{ col.1 }}, {{ col.2}}</td>
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---