You should balance the needs of querying for children against updating the
parent - if you are checking for the lack of children much more than you are
actually updating parents, it will be way cheaper to implement a boolean
that denotes whether or not the parent has children. This isn't a relational
database, and thinking non-relationally (away from normalization) will yield
many performance benefits.

On Tue, May 25, 2010 at 10:50 AM, App Engine N00B <
[email protected]> wrote:

> Hi!
>
> I have many models:
>
> class Parent (db.Model) :
>  data = db.StringProperty()
>
>
> class Child1 (db.Model) :
>  parent = db.ReferenceProperty(Parent)
>  childData = db.StringProperty()
>
> class Child2 (db.Model) :
>  parent = db.ReferenceProperty(Parent)
>  childData2 = db.StringProperty()
>
> class Child3 (db.Model) :
>  parent = db.ReferenceProperty(Parent)
>  childData3 = db.StringProperty()
>
> ....
>
> I want a query which can give me a list of all parents which do not
> have a child yet. How do i do it?
>
> I do not want to maintain an identifier in the Parent model for each
> of the children as I want to add new child models very often.
>
> --
> 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]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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.

Reply via email to