How to bulkload a list property

6 views
Skip to first unread message

rchurch

unread,
Jun 13, 2008, 1:04:14 PM6/13/08
to Google App Engine
I have the following model:

class Location(db.Model):
title = db.StringProperty(required=True)
text = db.TextProperty()
imageUrl = db.StringProperty()
address = db.StringProperty(required=True)
addressOption = db.StringProperty()
city = db.StringProperty(required=True)
state = db.StringProperty(required=True)
stateShort = db.StringProperty(required=True)
zipcode = db.StringProperty(required=True)
email = db.StringProperty()
phone = db.StringProperty()
features = db.StringListProperty()
active = db.BooleanProperty(required=True, default=True)

I am trying to bulkload information to the model. I can't seem to
figure out how to specify the information for the "features"
StringListProperty. The bulkloader treats each character as a
seperate item in the list.

e.g. If the "features" column in the CSV file is:
[u'beach front']

the datastore treats the column as:
[,u,',b,e,a,c,h, ,f,r,o,n,t,',]

Thanks for the help!

Col Wilson

unread,
Jun 13, 2008, 3:16:08 PM6/13/08
to Google App Engine
I don't have any StringListPropertys, but I do need to doo a bulkload.
Can I see how you are doing that please?

@@

unread,
Jul 16, 2008, 5:49:12 AM7/16/08
to google-a...@googlegroups.com
hi
you can try this
   bulkload.Loader.__init__(self, 'Location',
                         [..............
                      ('features', str.split),
                          ...............
                          ])
Reply all
Reply to author
Forward
0 new messages