skurt skurt - 4 months ago 18
Python Question

How to config export property db.ListProperty(db.Key) in bulkloader

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

and the export fails. In export_transform I tried, see ??? in bulkloader_config.yaml below:

Any idea how to export the list of keys?

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


- kind: Receipt
connector: csv
columns: from_header
- property: __key__
export_transform: transform.key_id_or_name_as_string
- property: coupons
import_transform: transform.create_foreign_key('Coupon')
export_transform: transform.???


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:
    return ''.join(str_list)