【发布时间】:2011-08-06 19:33:13
【问题描述】:
我想在 django 模板中设置和重置标志变量。有没有办法做到这一点?
{% for software in softwares %}
//here want to asign default value to flag( flag = False)
{% for mysoftware in mysoftwares %}
{% if mysoftware.name == software.name %}
//here want to set value to True to flag( flag = True)
{{ software.name }}<br />
{% endif %}
{% endfor %}
//check flag here
{% if flag == False %}
Software not assigned.
{% endif %}
{% endfor %}
【问题讨论】:
标签: python google-app-engine django-templates