开发者

Move or copy an entity to another kind

Is there开发者_运维百科 a way to move an entity to another kind in appengine.

Say you have a kind defines, and you want to keep a record of deleted entities of that kind. But you want to separate the storage of live object and archived objects. Kinds are basically just serialized dicts in the bigtable anyway. And maybe you don't need to index the archive in the same way as the live data. So how would you make a move or copy of a entity of one kind to another kind.


No - once created, the kind is a part of the entity's immutable key. You need to create a new entity and copy everything across. One way to do this would be to use the low-level google.appengine.api.datastore interface, which treats entities as dicts.


Unless someone's written utilities for this kind of thing, the way to go is to read from one and write to the other kind!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜