开发者

How to if !something

开发者 https://www.devze.com 2023-02-09 06:49 出处:网络
I\'m just learning GAE, Python and Django and have a problem with my Django template. I understand the GAE version of Django is 0.96 and so predates a lot of the fancy {% if x == False %} st开发者_Go百

I'm just learning GAE, Python and Django and have a problem with my Django template. I understand the GAE version of Django is 0.96 and so predates a lot of the fancy {% if x == False %} st开发者_Go百科uff.

All I want to do is:

{% if NOT variable.approved %}
  This should render if the approved property is False
{% end if %}

The approved property is a db.BooleanProperty(default=False, required=True) in my DataStore.

Thanks


You can just do {% if not variable.approved %}. This is explained in, for example, the 1.1 documentation.

Note that you can install Django 1.2 in GAE, if you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消