views:

86

answers:

1

bulkoader.yaml:

transformers: 
    - kind: ExampleModel 
      connector: csv 
      property_map: 
        - property: __key__ 
          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?

+1  A: 

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

- property: data
  external_name: data
  import_transform: db.Text
Nick Johnson
Thanks. But now I get: Error parsing yaml file:Unable to assign value 'db.Text' to attribute 'import_transform':Invalid code for import_transform. Code: "db.Text". Details: name 'db' is not defined in "bulkloader.yaml", line 33, column 29
Matt H
You need to add "from google.appengine.ext import db" to your Python imports section.
Nick Johnson
Ah! That was so simple. >_>Thanks Nick!
Matt H