开发者

Using upload_data on Google AppEngine doesn't let me update entities with id based keys

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 开发者_Python百科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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜