djangoのテンプレートシステムを使用していますが、次の問題が発生しています。
辞書オブジェクトexample_dictionaryをテンプレートに渡します。
example_dictionary = {key1 : [value11,value12]}
そして私は次のことをしたい:
{% for key in example_dictionary %}
// stuff here (1)
{% for value in example_dictionary.key %}
// more stuff here (2)
{% endfor %}
{% endfor %}
ただし、これは2番目のforループには入りません。
確かに、私が置くなら
{{ key }}
(1)では、正しいキーが表示されますが、
{{ example_dictionary.key }}
何も表示されません。
この回答では、誰かが使用することを提案しました
{% for key, value in example_dictionary.items %}
ただし、この場合、(1)特定のキーに関する情報が必要なため、これは機能しません。
どうすればこれを達成できますか?私は何かが足りないのですか?