Jinja2 returns "None" string for Google App Engine models
- by Brian M. Hunt
Google App Engine models, likeso:
from google.appengine.ext.db import Model
class M():
name = db.StringProperty()
Then in a Jinja2 template called from a Django view with an in instance of M passed in as m:
The name of this M is {{ m.name }}.
When m is initialized without name being set, the following is printed:
The name of this M is None.
The preferable and expected output (and the output when using Django templates) would be/is:
The name of this M is .
Do you know why this is happening, and how to get the preferred & expected output?