ConfusedNoob
ConfusedNoob

Reputation: 10196

How to if !something

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 %} stuff.

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

Upvotes: 0

Views: 91

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599758

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.

Upvotes: 8

Related Questions