for item in query_results:
num +=1
print num
this will give you 1, 2, 3, 4 etc
I then tried doing this in django templates doing the following
{% for item in query_results %}
<tr>
<td>{{ item.user }}</td>
<td>{{ num|add:"1" }}</td>
</tr>
{% endfor %}
But this only returns 1, 1, 1, 1, 1 etc. This says to me that the 1 isn’t being saved to num each cycle. IS this then not a capability of django templates, or am i just doing it wrong.
Use forloop.counter instead.