[sqlalchemy] using with_polymorphic() on joined tables

2009-06-10 Thread David Gardner
I was wondering if there was a way to use with_polymorphic() on a joined table. For instance using the Company-Employees relationship in the example on http://www.sqlalchemy.org/docs/05/mappers.html#mapping-class-inheritance-hierarchies if I wanted to query for a company, and eagerload the

[sqlalchemy] Re: using with_polymorphic() on joined tables

2009-06-10 Thread Michael Bayer
yeah. OK we only have limited support for that concept right now using of_type(), which currently only supports one type, not a list. so it would be query(Company).join(Company.employees.of_type(Engineer)). In theory of_type() could support a list, but that isnt built right now.