Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用旧数据库,我可以调用Model.get_by_id([1, 2, 3])以获取实体列表。
Model.get_by_id([1, 2, 3])
NdbModel.get_by_id不支持将 id 列表作为参数。复制旧功能的最佳方法是什么?
Model.get_by_id
您使用获取键列表的函数 get_multi。
objects = ndb.get_multi([ndb.Key(Model, k) for k in ids])