Hello,
Is it possible to use forloop.counter0 as an index into a list?
For example:
in my view I have:
array=[10,11,12,13]
in my template I have:
{% for item in items %}
counter = {{ forloop.counter0 }}<BR>
1st val of array = {{ array.0 }}<BR>
nothing appears here: {{array.forloop.counter0 }}<BR>
---------------<BR>
{% endfor %}
This is what comes out the browser:
counter = 0
1st val of array = 10
nothing appears here:
---------------
counter = 1
1st val of array = 10
nothing appears here:
---------------
Thanks in advance,
Brandon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---