To get the parent-child relation: specify the parent= attribute of the object constructor for the child. All the links/relations are stored in the Key of the object, you don't have to put any Properties in the Model definition.
myObj = Model(parent=someparent,.....) myObj.put() If you want to find an object that has a certain parent object use the ancestor() call of a Query http://code.google.com/appengine/docs/python/datastore/queryclass.html#Query_ancestor For GQL look here http://code.google.com/appengine/docs/python/datastore/gqlreference.html 2009/8/27 Laimonas Simutis <[email protected]>: > > Maybe my search skills are sucking at the moment, but I am failing to > find a good example of Entity Group modeling. > > I started here: > http://code.google.com/appengine/docs/python/datastore/modelclass.html > (The Model class) > > which then led me to > http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html > (Keys and Entity Groups) > > > Mainly, what I am trying to find is how to declare the Parent and > Child objects, and then how does parent "walk" to child and vice > versa. > > If I have > > class MyParent(db.Model): > > > class MyParentChild(db.Model): > > > what do I add to the above declarations to wire up parent and child to > be part of an entity group. Do I still use ReferenceProperty? (but > what if I want one to one and not one to many?) > > Thanks for any pointers, > > L > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
