Zhaiduo
Zhaiduo

Reputation: 49

Django template has no IN operator on Google Appengine?

I use {% if user in users %} in template, but get this error:

TemplateSyntaxError: 'if' statement improperly formatted

Does Django template have no IN operator on Google Appengine? Is there a way to achieve like this?

Upvotes: 0

Views: 339

Answers (2)

jm_toball
jm_toball

Reputation: 1217

Did you set up Django on appengine? The app engine sdk version is fairly old. Make sure you have Django 1.2 or higher installed or the smart if template tag[1] installed for lower versions.

1: http://djangosnippets.org/snippets/1350/

Upvotes: 0

Adam Crossland
Adam Crossland

Reputation: 14213

The in operator is definitely present in Django templates 1.2, but it probably isn't available in the much less powerful 0.96 templates, which is the default in the current version of the AppEngine SDK. It is fairly simple to switch to 1.2. The instruction are in the AppEngine Docs.

Upvotes: 3

Related Questions