views:

62

answers:

1

This seems so basic - I must be missing something.

I am trying to download my entities, update a few properties, and upload the entities. I'm using the Django nonrel & appengine projects, so all the entities are stored as id rather than name.

I can download the entities to csv fine, but when I upload (via appcfg.py upload_data ...), the keys come in as name=... rather than id=...

In the config file, I added -

   import_transform: transform.create_foreign_key('auth_user', key_is_id=True)

to see if this would, as the documentation for transform states, "convert the key into an integer to be used as an id." With this import_transform, I get this error -

ErrorOnTransform: Numeric keys are not supported on input at this time.

Any ideas?

A: 

As the error message indicates, overwriting entities with numeric IDs isn't currently supported. You may be able to work around it by providing a post-upload function that recreates the entity with the relevant key, but I'd suggest stepping back and analyzing why you're doing this - why not just update the entities in-place on App Engine, or use remote_api to do this? Doing a bulk download and upload seems a cumbersome way to handle it.

Nick Johnson
Thanks for the response. To your suggestions: 1. I'll have to check into the post-upload function. Do you have a link to the documentation for this? 2. I have too many entities to edit in-place. Some are new, some are existing. 3. remote_api is required for upload_data, so I assume that upload_data uses remote_api underneath. I'm not familiar with the other uses of remote_api, what do you suggest?
Guy
"Too many entities to edit in place" - what does this mean? You can automate editing in place just as easily as you can automate modifying a dump - easier, in fact, especially with the new mapper API.
Nick Johnson