XXXX property is not a multi-line exception in python GAE

I have a simple model object with

profilename = db.StringProperty()

and when I get the line with "Some More" and try

to set

in the model, it throws an exception

The profilename property is not multi-line

Is space equivalent to a new line or am I missing something?

put ting

for single lines of words without spaces.

+3
source share
1 answer

The verification is performed at the application level, in particular, in StringProperty.validate - the corresponding code (which you can find in your SDK sources in the ext / db / init .py file ):

if not self.multiline and value and value.find('\n') != -1:
  raise BadValueError('Property %s is not multi-line' % self.name)

, \n , value, . ,

logging.info('value is: %r', value)

put, - ? %r repr , , \n, , .

+4

Source: https://habr.com/ru/post/1729126/


All Articles