【发布时间】:2014-09-10 03:05:13
【问题描述】:
我在 django 模板中有一个名为 income 的字典,我的模板中还有一个名为 factors 的列表,我想要这样的东西:
{% for factor in factors%}
<div> {{ income[factor.id] }} </div>
{% endfor %}
但是 {{ income[factor.id] }} 是错误的,我该怎么做?
【问题讨论】:
标签: python django dictionary django-templates