gpt4 book ai didi

python - 无法使用 NDB get_by_id 获取命名空间中的实体

转载 作者:太空宇宙 更新时间:2023-11-04 01:35:27 25 4
gpt4 key购买 nike

我想在当前命名空间之外使用如下内容进行阅读:

some_entity = MyModel.get_by_id(some_id_name, namespace='somenamespace')

但是 get_by_id 不以命名空间作为参数。我得到:

TypeError: Unknown configuration option ('namespace')

我已经得到了可以使用的东西:

some_entity = ndb.Key(MyModel, some_id_name, namespace='somenamespace').get()

所以现在我只是在提示,但我认为其他人可以从中受益。 :) 此外,由于 Guido 对此进行监控,是否有理由不允许 get_by_id 中的命名空间选项?

编辑: This is now possible in App Engine 1.7.0.

最佳答案

请在 NDB 问题跟踪器中提交功能请求:http://code.google.com/p/appengine-ndb-experiment/issues/list

关于python - 无法使用 NDB get_by_id 获取命名空间中的实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10321244/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com