2

私は何を間違っていますか??

from google.appengine.ext import db

class Owner(db.Model):
    things = db.ListProperty(db.Key)

class Thing(db.Model):
    pass

t1 = Thing(key_name='thing1')
t2 = Thing(key_name='thing2')
t1.put()
t2.put()

o = Owner(key_name='me')
o.things = [t1.key(), t2.key()]
o.put()

result = Owner.all().filter('things=',t1).fetch(10)
print result  # returns empty list!!
4

1 に答える 1

1

最初のフィルタ引数のプロパティ名と演算子の間にはスペースが必要です。

悪い:

Owner.all().filter('things=',t1)

良い:

Owner.all().filter('things =',t1)
于 2013-03-10T17:57:17.193 に答える