According to the docs: http://code.google.com/appengine/docs/python/datastore/datamodeling.html#References the automatically created reverse reference object is a Query object, so there is possible iteration over it and making fetch calls.
But: I have one model:
class User(db.Model):
name = db.StringProperty()
...
and second model:
class Thing(db.Model):
owner = db.ReferenceProperty(User)
...
And when I try to access reverse reference:
for thing in user.thing_set:
...
or:
user.thing_set.fetch(100)
I get an exception like this:
<type 'exceptions.TypeError'>: '_ReverseReferenceProperty' object is not iterable
or like this:
<type 'exceptions.AttributeError'>: '_ReverseReferenceProperty' object has no attribute 'fetch'
Am I doing something wrong or there was some change in appengine? I'm pretty sure that previously it worked like a Query. There is even an example on the docs page, that shows the same usage as mine:
for obj in obj1.secondmodel_set:
# ...
Additionaly getting the query without reverse reference works ok:
things = Thing.all().filter('owner =', user)