Obviously I want to select for each iteration another item from the array. Unluckily something like:
arr.forloop.counter0 forloop.counter0 is the variable that holds the currently used index in a for loop: http://www.djangoproject.com/documentation/0.96/templates/#for Any idea how I could select an item from arr using forloop.counter0 ? Thx...jago On Nov 7, 10:38 am, Raja <[EMAIL PROTECTED]> wrote: > You can use something like {{ array.index}} to get the value of a > specific index. > > For e.g. > > arr = [1,2,3,4] > > In view, if I do a > {{ arr.1 }}, it should return 2 > > -- Raja > > On Nov 7, 5:52 am, jago <[EMAIL PROTECTED]> wrote: > > > I have a for loop over a list A. > > > inside the loop I want to print out the item of list B at the index > > 'forloop.counter0' of list A. > > > It is really strange. One can select randon items in a list, or the > > first item in a list, but I did not find a way to select the list item > > by index. > > > Am I missing something? --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---