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
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
- [Answered ]-Django REST-framework: Making a field optional
- [Answered ]-Many views which inherit from templateview
- [Answered ]-Django model clean and ManytoMany problem
Source:stackexchange.com