laspal kirjoitti: > Hi, > I have 2 list and want to iterate as one in template. > How can I do it. > example-> > list1 = [10,20,30,30] > list2 = [aa,bb,cc,dd]
combinedlist = ( (a[x],b[x]) for x in range(len(a)) ) > {% for item in list1 and item1 in list2 %} {% for item,item1 in combinedlist %} > {{item}} {{item1}} > > {% endfor%} {% endfor %} > You could try that one. Of course, if you can put values in tuples while generating list(s) it would be much more efficient than joining them afterwards. -- Jani Tiainen --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---