TemplateSyntaxError:'if'语句格式不正确

Gin*_*nni 4 python django google-app-engine

    {% for frequency in patient_meds.frequency %}
            {% if frequency == "7" %}
            <td>Hellow</td>
            {% endif %}
    {% endfor%}
Run Code Online (Sandbox Code Playgroud)

得到错误

TemplateSyntaxError:'if'语句格式不正确

我不知道我要做什么请帮帮我...

Dav*_*ill 6

如果您使用的是app引擎附带的Django默认版本(v0.96),请尝试以下语法:

{% for frequency in patient_meds.frequency %}
        {% ifequal frequency "7" %}
            <td>Hellow</td>
        {% endif %}
{% endfor%}
Run Code Online (Sandbox Code Playgroud)