Re: [google-appengine] Searching through Model relationships in Google App Engine?

2010-06-01 Thread Ikai L (Google)
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 <
vivek.securitywiz...@gmail.com> 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 google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com
> .
> 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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Searching through Model relationships in Google App Engine?

2010-05-25 Thread App Engine N00B
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 google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.