擅长:python、mysql、java
<p>在这种情况下,<a href="https://developers.google.com/appengine/docs/python/ndb/async" rel="nofollow">ndb asyc api</a>可能有用。。。在</p>
<pre><code>@ndb.tasklet
def get_b_instances_from_a_instances(a_instance):
b_instance = yield a_instance.b.get_async()
raise ndb.Return((a_instance, b_instance))
entities = A.query().map(get_b_instances_from_a_instances, limit=200)
</code></pre>
<p>现在你的<code>entities</code><a href="https://developers.google.com/appengine/docs/python/ndb/queryclass#Query_map" rel="nofollow">will be a list</a>,其中每个元组都有一个<code>A</code>的实例,它对应于{<cd3>}。在</p>