Using forloop.counter value as list index in a Django template
问题 in my Django 1.1.1 application I've got a function in the view that returns to his template a range of numbers and a list of lists of items, for example: ... data=[[item1 , item2, item3], [item4, item5, item6], [item7, item8, item9]] return render_to_response('page.html', {'data':data, 'cycle':range(0,len(data)-1]) Inside the template I've got an external for loop, that contains also another for cycle to display in output the contains of the inner lists of data in this way ... {% for page in