I have a model that looks like this:
class Foo(ndb.Model):
bar = ndb.TextProperty(required=True)
# other properties
I’m using jinja2 for templating:
{{ bar|safe }}
I ‘put’ in this:
<p>I think it is always going to be challenging planning a wedding in a foreign country. 1234 Weddings was able to pre-arrange everything before our arrival and even meet us at the airport to attend to last minute details.<br> The wedding itself was even more amazing than we could have imagined and flawless. For our day, 1234 Weddings became a part of our family and our memories. We are so greatful for the professional communication and creativity that made our day so special.</p>
And ndb mangles the text, outputting this:
<p>I think it is always going to be challenging planning a wedding in a for=
eign country. 1234 weddings was able to pre-arrange everything before our a=
rrival and even meet us at the airport to attend to last minute details.<br=
>The wedding itself was even more amazing than we could have imagined and f=
lawless. For our day, 1234 Weddings became a part of our family and our mem=
ories. We are so greatful for the professional communication and creativity=
that made our day so special.</p>
This only happens on my deployed site. The identical code on localhost doesn’t produce this issue.
Possibly relevant:
- My local app engine doesn’t have a persistant datastore.
- bar was originally of type ‘StringProperty’. I noticed the issue after I changed the type to ‘TextProperty’, but there wasn’t extensive testing before the change so it’s possible the issue existed prior to that.
Any help would be appreciated.
TIA.
There is a bug in the blobstore upload handler that causes encoding problems with text submitted at the same time, comments here have a patch that has worked for me in the past: http://code.google.com/p/googleappengine/issues/detail?id=2749