On 08/26/10 10:17, Andrea Imparato wrote:

I have 2 lists and I have to scan them "concurrently" with the same
indexes at the same time. Something like:

{% for lists %}
first item from the first list
first item from the second list
{% endfor %}

I thought about creating something like a map with 2 values in each
index but I don't know how to use it in the template.

Just zip() them up in your view:


  def my_view(request, ...):
    first = ...
    second = ...
    pairs = zip(first, second)
    return render_to_response(... pairs ...)


-tkc



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected].
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