The keys are probably not the same on dev and production, unlikely that the ids will be the same for the object or the parent, and maybe the dev server uses a different algorithm to construct keys.
Make sure you upload first all the object that you want to reference too. They must have some sort of primary key that you can use in a query. In the Book csv file you must name the primary key of the library. In the Book class bulkload.Loader you must implement a def HandleEntity(self, entity): method, here you query for the Library object with the right primary key. from this object get it's key and update the entity key with the name of the ReferenceProperty, (entity argument is a dictionary). You can have the primary key passed in the same name. 2009/1/14 Chris <[email protected]>: > > Whats the best way to maintain referential integrity with the > ReferenceProperty when using the bulkupload script? > > For example, suppose I had a Book class that references a Library > class, and I wanted to upload these instances in my local datastore to > the production datastore. Would the production datastore acknowledge > the key stored in the Book's ReferenceProperty, or are the keys > between dev and production completely different? If different, what > would be the best way to translate the keys in order to maintain > referential integrity? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
