I'm especially interested in solutions with source code available (django independency is a plus, but I'm willing to hack my way through)
views:
304answers:
2
+5
A:
You can, of course, write your own handler. Other than that, your options currently are limited to:
Nick Johnson
2009-01-09 10:12:41
+1
A:
Update: New version of Google AppEngine supports data import to and export from the online application natively. In their terms this is called upload_data
and download_data
respectively (names of subcommands of appcfg.py
).
Please refer to Google documentation how to export and import data from/to GAE. This is probably the better way to do it today.
My old answer is below:
I use to_xml() method of the Model class to export the datastore.
class XmlExport(webapp.RequestHandler):
def get(self):
objects=MyModel.all().fetch(1000)
xml='<?xml version="1.0" encoding="UTF-8"?>\n<site>\n'
for o in objects:
xml = xml + o.to_xml()
xml = xml + '</site>'
self.response.headers['Content-Type']='text/xml; charset=utf-8'
self.response.out.write(xml)
jetxee
2009-01-12 16:09:03