Sure. {% for gallerykind in gallerykinds %} <td class="thumb"> <a href="/create? index={{ gallerykind.index }}">{{ gallerykind.title }}</a>
{% if gallerykind.author %} <br/><span>by <a rel="nofollow" href="/gallery? username={{ gallerykind.author }}">{{ gallerykind.author }}</a></span> {% endif %} <br/><span>{{ agelist.forloop.counter0 }}</span> </td> {% endfor %} My problem is agelist. I tried to indicated my intent by writing agelist.forloop.counter0. Where do I do this zip() operation? In the python code before constructing the template or in the django-code? wrapper = zip(list1, list2) Access in the django code is then: {% for w in wrapper %} w.0.title w.1 ??? On Nov 7, 4:45 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Nov 7, 2:12 pm, jago <[EMAIL PROTECTED]> wrote: > > > I tried the slice solution before. Unluckily it returns a list itself > > holding 1 item instead of the item itself. Most importantly though I > > cannot use a variable like forloop.counter0 to select the item I want > > but instead can only use static numeric values like 1,2,3 > > Hmm, if you're already looping through something, you should probably > make sure that all the things you need to refer to are contained in > the same iterable - for example by using zip(list1, list2) in your > view. > > If you posted some code showing what you are trying to do, we might be > able to help a bit more. > -- > 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 -~----------~----~----~----~------~----~------~--~---