Overcome appengine 500 byte string limit in python

2019-07-16 14:24发布

问题:

I get this:

BadValueError: Property   is 804 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.

I read this: http://blog.zmxv.com/2012/02/appengine-go-sdks-500-byte-string.html and this: App Engine BadValueError On Bulk Data Upload - TextProperty being construed as StringProperty but I still don't understand how to solve it quickly.

It says, consider text? I'm willing to consider text!:)

If I limit user input to 500 chars, will that solve everything? Thanks..

回答1:

so consider the TextProperty.

switch from.

yourproperty = db.StringProperty()

to

yourproperty = db.TextProperty()

and you will be fine. keep in mind that TextProperty is not indexed.