views:

84

answers:

1

Hi!

I have a model with a list property.

I have a csv that has each list data that looks like this.

[u'1234567']

The list has only one item each.

My bulkloader.yaml has configured import_transform: transform.none_if_empty(list). It uploads the above list property as [u'[', u'u', u"'", u'1', u'2', u'3', u'4', u'5', u'6', u'7', u"'", u']']

How should I configure the import_transform in order to upload it properly?

Thanks!

+1  A: 

Try something like this:

import_transform: lambda x: [x] if x else None
Nick Johnson
Didn't work for me yet. It says...Error parsing yaml file:Unable to asssign value 'lambda x' to attribute 'import_transform':Invalid code for import_transform. Code: "lambda x". Details: unexpected EOF while parsing <<string>, line 1>Any ideas?
Albert
Hm. You may have to put the transform in a Python module, then import it and use it in the same way the bulkloader imports other modules in the yaml config.
Nick Johnson