I have a list with a nested list returned from my view, something like -
[[1, [1, 2, 3]], [2, [2, 3, 4]], [3, [3,4,5]]] I want something like this, which would work in python -
for obj in my_list: for nested_obj in obj[1]: print nested_obj But with the django template system, if I try -
{% for obj in data_list %} <h2>{{obj.0}}</h2> <p> {{for nested_obj in obj.1}} <h5>{{nested_obj}}</h5> {{ endfor }} </p> {% endfor %} I get -
Could not parse the remainder: ' nested_obj in obj.1' from 'for nested_obj in obj.1' Why is this? Thanks!
Edit - So, that was stupid - I wrote {{for .... }} instead of {% for ... %} Thanks @allcaps