On Nov 7, 12: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?

Use the slice filter.

{{ mylist|slice:"2" }}

--
DR.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to