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

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM