我可以同时遍历 django 模板中的两个数组/列表吗?
像这样的东西:
# views.py
a = [{'a':'apple','b':'banana','c':'clementine'},
{'a':'aunt','b':'brother','c':'cousin'},
{'a':'ant','b':'bat','c':'cat'}]
b = [{'d':'dave','f':'fred'},
{'d':'dason','f':'ford'},
{'d':'dance','f':'flamenco']
# something.html
{% for x, y in a and b %}
{{ x.a }},{{ x.c }}<br>
{{ y.f }}
{% endfor %}