Hi Thomas, Your observation is correct, each query can only retrieve entities of a single kind at the moment, so you would need to perform a separate query for each subclass. Your solution of using just the one Base class with additional properties sounds like a very reasonable solution.
Happy coding, Jeff On Sep 8, 11:49 am, Cat <[EMAIL PROTECTED]> wrote: > I am using a factory pattern to model my data. Creating the data is > simple. Retrieving it is hard. > > class Owner() > class Base(db.Model) > group = StringProperty(default="abc") > @classmethod > def factory(): ... > class Sub1(Base) > class Sub2(Base) > > Problem: I want to query for all classes with ancestor == owner (and > group == 'abc'). > So to say run a query against a whole entity group. However it appears > I can only retrieve a "Kind"/Class at a time? > > Base.all().ancestor(owner).fetch(100) will only return Base instances > not Sub1 and Sub2 > Sub1.all().ancestor(owner).fetch(100) will only return Sub1s > > Question: Is there any query that could return mixed type lists? > > Some solutions I can think of is > * to add a 1000 item ListProperty(RefereneProperty) to Owner ... needs > to be filtered manually by group (slow?) > * to use Base(Expando) with a type property instead using > subclasses ... loose some prop checking > > Is there a better way to do that? > > Thanks, > Thomas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
