dict = {'day_1': {
'name': 'Иван'; 'card': {
'1': 'кроссовки'; '2': 'кепка'}},
'day_2': {
'name': 'Вася'; 'card': {
'1': 'тетрадь'; '2': 'ручка'}}
}
{% for y, dict_1 in dict.items %}
{% for y, dict_2 in dict_1 ????? %}
<p>...</p>
{% endfor %}
{% endfor %}
from django import template
register = template.Library()
@register.filter
def get_item(dictionary, key):
return dictionary[key]
{% for y, dict_1 in dict.items %}
{% load filters %}
{% with item=dict_1|get_item:'card' %}
{% for y, dict_2 in item.items %}
<p>dict_2</p> #словарь card
{% endfor %}
{% endwith %}
{% endfor %}