擅长:python、mysql、java
<blockquote>
<p>How do I construct a query for all Reservations on a specific day in Days at a specific court in Courts on a specific weekday in (week)Days?</p>
</blockquote>
<p>您知道键的值,所以您可以手工创建一个键(可以这么说),然后使用该键作为祖先进行查询。在</p>
<p>例如:</p>
<pre><code>key = ndb.Key(BlogPost, 12345)
qry = Comment.query(ancestor=key)
</code></pre>
<p>但在这里你可以用类似</p>
^{pr2}$
<p>以此类推,这样你就可以沿着链条往下走,用你掌握的所有信息(即他们想保留哪家法庭)来构建密钥。
然后祖先查询的结果将是那些拥有您作为其祖先传递的键的模型。在</p>
<p><a href="https://developers.google.com/appengine/docs/python/ndb/queries#ancestor" rel="nofollow">https://developers.google.com/appengine/docs/python/ndb/queries#ancestor</a></p>