python tuple and list 在django template中的使用如下所示:
mylist = [(a, b, c), (x, y, z), (l, m, n)]
{% for item in mylist %}
{{ item.0 }} {{ item.1}} {{ item.2 }}
{% endfor %}
本文展示了如何在Django模板中利用tuple和list进行数据迭代和输出,通过实例演示了具体操作步骤。
python tuple and list 在django template中的使用如下所示:
mylist = [(a, b, c), (x, y, z), (l, m, n)]
{% for item in mylist %}
{{ item.0 }} {{ item.1}} {{ item.2 }}
{% endfor %}
1290
1193
938

被折叠的 条评论
为什么被折叠?