[Answered ]-Google app engine: reverse reference lookups

1👍

Yes. You can access the pics, via:

user = User()
pics = user.portfolio_set

You can change the default name (which is modelname_set) by passing the collection_name argument to the ReferenceProperty constructor. For example:

class Portfolio(db.Model):
  user = db.ReferenceProperty(User, collection_name="Portfolio")

See more information and examples here: http://code.google.com/appengine/docs/python/datastore/entitiesandmodels.html

👤arikfr

1👍

Yes it is possible.
By default you can access users portfolio through user.portfolio_set.
Read here for more info: http://code.google.com/intl/pl/appengine/articles/modeling.html

Leave a comment