0
我的情况,我需要跨越像in the Django database model查询谷歌App Engine的实体关系是。我使用ListProperty
S代表一个一对多的关系,就像这样:GQL查询,以有效地跨越实体关系
class Foo(db.Model): bars = db.ListProperty(db.Key)
class Bar(db.Model): eggs = db.ListProperty(db.Key)
而且我想执行一个查询,执行以下操作:
# Foo.filter('bars.eggs =', target_egg)
[foo
for egg in eggs if egg == target_egg
for eggs in bar.eggs
for bar in foo.bars
for foo in Foo.all()]
的理解似乎根本低效。我真的很想执行查询作为注释部分,但它并不像the GQL syntax允许对属性的属性查询:
SELECT * FROM <kind>
[WHERE <condition> [AND <condition> ...]]
[ORDER BY <property> [ASC | DESC] [, <property> [ASC | DESC] ...]]
[LIMIT [<offset>,]<count>]
[OFFSET <offset>]
<condition> := <property> {< | <= | > | >= | = | != } <value>
<condition> := <property> IN <list>
<condition> := ANCESTOR IS <entity or key>