【发布时间】:2010-05-08 17:13:09
【问题描述】:
在 Python 中的 Google App Engine 上,我有一个 Visit 实体,其父级为 Patient。一位患者可能有多次就诊。
我需要在某处设置 most_recent_visit(和一些辅助访问数据)以供以后查询,可能在另一个子实体中,Brett Slatkin 可能称之为“关系索引实体”。
我希望以如下方式批量处理:
1. get 100 Patient keys
2. get all Visits that have any of the Patients from 1 as an ancestor
3. go through the Visits and get the latest for each Patient
有什么方法可以批量执行第 2 步吗?
我知道有一种方法可以从键列表中批量获取实体,并且有一种方法可以通过其祖先来匹配单个实体。
【问题讨论】:
标签: python google-app-engine google-cloud-datastore