Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将db.ComputedProperty从StringProperty更改为TextProperty_Python_Google App Engine_Text_Properties - Fatal编程技术网

Python 将db.ComputedProperty从StringProperty更改为TextProperty

Python 将db.ComputedProperty从StringProperty更改为TextProperty,python,google-app-engine,text,properties,Python,Google App Engine,Text,Properties,我是GAE的新手,我尝试使用@db.ComputedProperty动态添加字段值 但是,我收到了错误消息 属性xxxx的长度为721字节;它必须是500或更少。考虑文本代替,它可以存储任何长度的字符串。 @db.ComputedProperty似乎默认为StringProperty 有没有办法将其更改为TextProperty?让您的计算属性返回db.Text的实例,而不是字符串。但是,正如Wooble指出的那样,这样做毫无意义:computed属性的存在是为了帮助索引,如果您不为数据编制索引

我是GAE的新手,我尝试使用@db.ComputedProperty动态添加字段值 但是,我收到了错误消息

属性xxxx的长度为721字节;它必须是500或更少。考虑文本代替,它可以存储任何长度的字符串。 @db.ComputedProperty似乎默认为StringProperty
有没有办法将其更改为TextProperty?

让您的计算属性返回db.Text的实例,而不是字符串。但是,正如Wooble指出的那样,这样做毫无意义:computed属性的存在是为了帮助索引,如果您不为数据编制索引,那么您也可以使用常规属性,而不将其存储在数据存储中。

为什么要以无法索引的方式存储计算属性?如果你不使用它来搜索,你就不能在读取时计算它吗?