I'm building a django webpage but I seem to have hit a snag as I can't really figure out how to use the current iteration of a for loop (in the template) for multiple lists:
{% for num in loopRange %}
<tr>
{% for num2 in subRange %}
<td>{% cycle list1 list2 list3 list4 %}</td>
{% endfor %}
</tr>
{% endfor %}
I found a couple questions here stackoverflow that were similar and I attempted to use cycle, but alas this just resulted in all members of the list being printed each time--not exactly unexpected but I can't figure out how for the life of me.
What I have is multiple lists that are all similar in content, each list is a column in a row. So, if it was python and I was concatenating strings it would be like this:
for i in xrange(5):
string = list1[i] + list2[i] + list3[i] + list 4[i]
So basically that. I'm passing each list in as context in addition to two xranges (loopRange and Subrange in the first example), I need five rows (each list has five members) and four columns (four lists).
EDIT: I suppose in a nuthshell I want to refer to list indeces as foo[bar], done in django as foo.bar, however bar apparently can't be an integer an iterable range passed in as content
Thanks!