I'm trying to iterate a dictionary of dictionary in Django template page
{% for (key_o, value_o) in f_values.items() %}
<tr class="row {% cycle 'odd' 'even' %}">
{% for (key_i, val_i) in value_o.items() %}
<td class="tile ">
{{ val_i }}
</td>
{% endfor %}
</tr>
{% endfor %}
But getting the error
TemplateSyntaxError at /tree/branches/
Could not parse the remainder: '()' from 'f_values.items()'
What is causing the error?
--update
This is how i creating the f_values
columnValues = []
for idx_o, val_o in enumerate(results['values']):
columnValues[idx_o] = {}
for idx_i, val_i in enumerate(val_o):
columnValues[idx_o][idx_i] = {}
columnValues[idx_o][idx_i]['value'] = val_i
name = columnNames[idx_i]
columnValues[idx_o][idx_i]['name'] = name
columnValues[idx_o][idx_i]['format'] = {}
for val_f in formats:
if (name == val_f.Header) :
columnValues[idx_o][idx_i]['format']['LowerLimit'] = val_f.LowerLimit
data = {
'f_values': columnValues,
}