开发者

App Engine BadValueError On Bulk Data Upload - TextProperty being construed as StringProperty

bulkoader.yaml:

transformers: 
    - kind: ExampleModel 
      connector: csv 
      property_map: 
        - property: __key__ 开发者_如何学Python
          external_name: key 
          export_transform: transform.key_id_or_name_as_string 
        - property: data 
          external_name: data 
        - property: type 
          external_name: type 

model.py:

class ExampleModel(db.Model): 
        data = db.TextProperty(required=True) 
        type = db.StringProperty(required=True) 

Everything seems to be fine, yet when I upload I get this error: BadValueError: Property data is 24788 bytes long; it must be 500 or less. Consider Text instead, which can store strings of any length.

For some reason, it thinks data is a string property.

Any one know how I can fix this?


You need to specify an import transform for the text field, like this:

- property: data
  external_name: data
  import_transform: db.Text
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜