{% for item in list%}{{ item }}{% endfor %}
But this fails (silently, of course) for dictionaries and the magic you are looking for is to call .items on the dictionary then iterate key,value across that:
{% for key,value in dictionary.items %}{{ value }}{% endfor %}
Edit: This is now covered in the django documentation itself.
Artículo original: acá.
No hay comentarios:
Publicar un comentario