开发者

Google App Engine retrieve user defined key name

Is there a way to retrieve the key name you set using:

Model(
  key_name = ...
  ...
)

I tried using the key() method but开发者_开发问答 that returns the one Google makes.


It is key().name()

Docs on the Key class


I was searching for the solution in my case of NDB datastore. check NDB Key link.

With NDB model, you have to use model.key.string_id()

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜