Код: Выделить всё
fruits:
- fruit: apple
color: red
texture: crunchy
shape: round
- fruit: grapefruit
color: yellow
taste: sour
- fruit: pear
color: yellow
Проблема в том, что существует несколько и переменное количество значений.
Код: Выделить всё
"{{ fruits | items2dict(key_name='fruit', value_name='??????') }}
Код: Выделить всё
fruits:
- apple:
color: red
texture: crunchy
shape: round
- grapefruit:
color: yellow
taste: sour
- pear:
color: yellow
Подробнее здесь: https://stackoverflow.com/questions/661 ... items2dict
Мобильная версия