I have a Python dictionary that looks like this. {0: {'record': u'running fast', 'moreInfo': u'test', 'year': u'2017', 'name': u'Jose la computadora', 'activity': u'Cross Country'}, 1: {'record': u'test', 'moreInfo': u'ttt', 'year': u'2000', 'name': u'Lewdog', 'activity': u'Cross Country'}}
I'm passing it to a Jinja template with Flask. The dictionary is set to the variable databaseQuery and passed to Jinja.
My jinja code looks like this, but nothing shows up on the page.
If I print databaseQuery on the page, I get the whole dictionary, and if I print test, I just get 0 1
.
I'm trying to figure out how to iterate through my dictionary and show each value for name on the page.
{% for test in databaseQuery %}
{{test["name"]}}
{% endfor %}
I've looked at this list of dictionary in jinja template but didn't have any luck.
Thanks!