【发布时间】:2012-03-27 01:48:09
【问题描述】:
我在 Google App Engine 网页中使用 Django 1.2 模板。
我将agemin 传递给模板以将选项标记为在 html 表单中选择。
但是下面的代码不起作用。
age 由 range(18,100) 创建
如何比较'i'和agemin?
{{agemin}} //this is for example 23
<select name=agemin><BR>
{% for i in age%}
<option {% if i == agemin %}selected{% endif %}>{{ i }}</option>
{%endfor%}
</select>
【问题讨论】:
标签: python google-app-engine django-templates