1👍
✅
Firstly, for constant keys, you don’t need a custom filter, this will work just fine:
{{ v.key1 }}
That said, data['GROUPS']
is a dict, and you want to iterate over its items
, like you did with data
.
data
is a list though and doesn’t need that:
<tbody>
{% for group, data in data.GROUPS.items %}
<tr>
<td>{{ group }}</td>
{% for v in data %}
<tr>
<td>{{ v.key1 }}</td>
<td>{{ v.key2 }}</td>
</tr>
{% endfor %}
</tr>
{% endfor %}
</tbody>
Source:stackexchange.com