返回的數據是列表集合,如
n [5]: a = set()
In [6]: a.add((1, 3))
In [7]: a
Out[7]: {(1, 3)}
在模板中使用方式如下:
{% for archive in archive_lists %}
<li>
<a href="/archive/{{ archive.0 }}/{{ archive.1 }} ">{{ archive }}</a>
</li>
{% endfor %}
參考見:
http://stackoverflow.com/questions/5231171/django-templatesyntaxerror-could-not-parse-the-remainder
