how can I achieve this in google appengine db model
from google.appengine.ext import db
Class Car(db.Model):
name=db.StringProperty()
model=db.StringProperty()
mileage=db.IntegerProperty()
Class Person(db.Model):
name=db.StringProperty()
age=db.IntegerProperty()
cars=db.ListProperty(Car) # How can I have cars object for person containing list of Car Objects?
Thank you
Have a look at the reference documentation http://code.google.com/appengine/docs/python/datastore/datamodeling.html#References
It works the other way round, class Car would have
which would make a property cars available in Person.
Hope this helps.