文書によると:http://code.google.com/appengine/docs/python/datastore/datamodeling.html#References 自動的に作成された逆参照オブジェクトはQueryオブジェクトなので、反復処理やフェッチ呼び出しが可能です。Appengine逆参照問題
しかし: 私は1つのモデルがあります:
class User(db.Model):
name = db.StringProperty()
...
及び第2のモデル:
class Thing(db.Model):
owner = db.ReferenceProperty(User)
...
そして、私は逆参照にアクセスしよう:
for thing in user.thing_set:
...
か:を
user.thing_set.fetch(100)
私はこのような例外を取得:
<type 'exceptions.TypeError'>: '_ReverseReferenceProperty' object is not iterable
またはこのような:
<type 'exceptions.AttributeError'>: '_ReverseReferenceProperty' object has no attribute 'fetch'
私が何か間違ったことをやっているかのAppEngineの何らかの変化がありましたか?以前はクエリのように機能していたと確信しています。べき
things = Thing.all().filter('owner =', user)
あなたは、任意の特定の状況を識別することができます第一の例外は第二の例外を引き起こすものである。 –