Uploading bulk data to data store

The documentation on how to upload bulk data to Google App Engine's data store: http://code.google.com/intl/es/appengine/docs/python/tools/uploadingdata.html

How to express relationships between models? How to support utf-8 in the bulk load?
Here is my loader.py

  1.  
  2. from appengine_django import InstallAppengineHelperForDjango
  3. InstallAppengineHelperForDjango()
  4.  
  5. import datetime
  6. from google.appengine.ext import db
  7. from google.appengine.tools import bulkloader
  8.  
  9. from myapp.models import *
  10.  
  11. class MyLoader(bulkloader.Loader):
  12. def __init__(self):
  13. bulkloader.Loader.__init__(self, 'MyModel',
  14. [('country',
  15. lambda x: Country.get_by_key_name(x)),
  16. ('code',
  17. lambda x: unicode(x, 'utf-8')),
  18. ('name',
  19. lambda x: unicode(x, 'utf-8'))
  20. ])
  21.  
  22. loaders = [MyLoader]
  23.  

The cvs:
ES, someCode, someName

The command line to upload the data:
.google_appengine/appcfg.py upload_data --config_file=loaders.py --filename=bulkdata.csv --kind=MyModel .

Problems I had: http://groups.google.com/group/google-appengine-python/browse_thread/thread/b524b5ad2cbecb30

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
  • http://www.fitnessmodels.info male fitness models

    Haha! Very funny! I like this site.

  • do.n.bach@yopmail.com

    why

    Country.get_by_key_name(x)