[Answer]-Nested for-cycles in Django templates

1👍

You need the full list of results for each placename.

In views.py:

places = [{'placename': x, 'results': x.traverse('hasid')} for x in placenames]
return render_to_response('search_results.html', {'places': places})

In the template:

{% for x in places %}
    {% for y in x.results %}
        <a>   {{ x.placename.name }} {{ x.placename.type  }} {{ y.loc_id }} </a><br></li>
    {% endfor %}
{% endfor %}

Leave a comment