-1

I started to export data from Google AppEngine with bulkLoader, configured in bulkloader.yaml. For "standard" data likes string, int and bool this is no problem. Even single keys are exported easily.

Now I have some data db.ListProperty(db.Keys) and the export fails. In export_transform I tried, see ??? in bulkloader_config.yaml below:

Any idea how to export the list of keys?

datamodel.py

    class Receipt(db.Model):
    coupons = db.ListProperty(db.Key) # only coupon ids of approved coupons

bulkloader_config.yaml

    - kind: Receipt
      connector: csv
      connector_options:
        columns: from_header
      property_map:
        - property: __key__
          export_transform: transform.key_id_or_name_as_string
        - property: coupons
          import_transform: transform.create_foreign_key('Coupon')
          export_transform: transform.???
Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
skurt
  • 1,019
  • 2
  • 13
  • 29
  • ... export_transform: transform.key_id_or_name_as_string ???? – Jimmy Kane Jan 11 '13 at 14:36
  • this is the part where it gets interesting. transform.??? are the methods that deal with the property, transform or not and throw the error message – skurt Jan 11 '13 at 15:49

1 Answers1

0

I have to do a little hack but it works

  def prop_name_converter(obj):
    if not obj:
      return ''
    str_list = []
    for o in obj:
      str_list.append(`o`)
    return ''.join(str_list)
skurt
  • 1,019
  • 2
  • 13
  • 29