Django常用模板标签

a.for 标签,用来循环显示列表各项的值,比如要显示wordpress文章列表:

{% for post in posts %} 
<div>
<h2><a href=”{{ post.guid }}”>{{ post.title }}</a></h2>
{{ post.content }}
</div>
{% endfor  %}

(阅读全文)


posted @ 2010-06-24 08:21  程序苦行僧  阅读(286)  评论(0编辑  收藏  举报