I'm trying to bulkload data using appcfg.py as described here. I got it working except setting parent entity, I can't seem to find info on how to set a parent entity for entity being created by the import. Can you point me to the right direction or provide a code snippet for my bulkloader.Loader implementation?
views:
26answers:
1
Q:
How to set parent for datastrore entity during bulkloading data by appcfg.py on Google App Engine?
+1
A:
You need to override the generate_key method of your Loader class. See this post for details.
Nick Johnson
2010-03-02 09:55:30
There is no example on how to set parent in that post :(
WooYek
2010-03-02 14:49:37
Just return the key you want your entity to have from the generate_key function. You can construct it with, eg, db.Key.from_path('kind', 'name', parent=parent_key)
Nick Johnson
2010-03-02 16:31:12