The pricing FAQ says that to take advantage of threading in python that we'll
need to update our code to Django 1.2.
In anticipation of that, I've added these lines at the very top of several
apps' main.py files:
from google.appengine.dist import use_library
use_library('django', '1.2')
I only use django for template substitution, so my reading of various porting
FAQs lead me to anticipate that my only problem would be that I need to add
"|safe" in a few places where I have markup in an attribute.
But it turns out my code hit one other surprise. The return value of
defaultfilters.slugify now doesn't return a plain string, but rather a
django.utils.safestring.SafeUnicode. You can't pass that into something that
is expecting a string. For example:
SomeModel.gql("WHERE slug = :1", defaultfilters.slugify(name))
will throw an exception. The fix is simple: wrap that call with a str():
SomeModel.gql("WHERE slug = :1", str(defaultfilters.slugify(name)))
Hope this info helps someone else avoid an exception!
-Joshua
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.