I want to simply list keys and values of a dictionary passed into a template,
but I haven't been able to figure out how.
I'd like to do something like:
{% for err in errors %}
{{ errors.err }}
{ % end for %}
In pure python I could do:
plotz = {'foo':'bar', 'fizz':'bang'}
for frob in plotz:
print frob
foo
fizz
I've been able to do this in the template, but I can't get the following to
work in a template:
for frob in plotz:
print plotz[frob]
bar
bang
Can I do this in a Django template?
Thanks in advance,
Eric.
{% for i in plotz.items %}
Key {{ i.0 }}
Value {{ i.1 }}
{% endfor %}