Django TemplateSyntaxError Could not parse the remainder: '()'

返回的数据是列表集合,如

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

  

posted @ 2016-06-12 23:32  wswang  阅读(4076)  评论(0编辑  收藏  举报