On Feb 13, 2009, at 12:05 PM, GustaV wrote:

>
> Hello!
>
> In a configuration looking like this:
> class Parent:
>   pass
>
> class Child(Parent):
>   pass
>
> class ChildChild(Child):
>   pass
>
> I would like to query the Childs and all classes that inherits it
> (here: ChildChild), but not Parent instances.
> session.query(Child).all() returns Child type only ( SQL : "WHERE type
> IN (2)" ), and I'd like to avoid to manually list the classes that
> inherit Child class.

query(Child) should be returning Child and ChildChild classes - the IN  
will include both subtypes.    make sure you're not on an old version  
of sqlalchemy.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to