Re: [sqlalchemy] Filters on specific tables of concrete polymorphic union

2017-04-13 Thread Kent
Awesome! I like the second approach better for the exact same reasons. Thanks so much! Kent On Thursday, April 13, 2017 at 1:50:40 PM UTC-4, Mike Bayer wrote: > > > it has nothing to do with joined table inheritance, in your example, > your base mapper is already mapped to

Re: [sqlalchemy] Filters on specific tables of concrete polymorphic union

2017-04-13 Thread mike bayer
it has nothing to do with joined table inheritance, in your example, your base mapper is already mapped to "preferences_union", so if you provide an alternative selectable that has no relationship to that, it does not see any of the required columns being provided. it's just like if your

Re: [sqlalchemy] Filters on specific tables of concrete polymorphic union

2017-04-13 Thread Kent
That was the first route I tried. with_polymorphic() seems to cater to or assume joined table inheritance. When I pass a selectable, it always ends up *joining *my base to that selectable instead of *using only my selectable*. My problem might be that I'm trying to take advantage of

Re: [sqlalchemy] Filters on specific tables of concrete polymorphic union

2017-04-13 Thread mike bayer
On 04/13/2017 10:24 AM, Kent wrote: Suppose we have the documentation's example of *Concrete Table Inheritance, *where session.query(Employee).all() produces this: SELECT pjoin.type AS pjoin_type, pjoin.manager_data AS pjoin_manager_data, pjoin.employee_id AS

[sqlalchemy] Filters on specific tables of concrete polymorphic union

2017-04-13 Thread Kent
Suppose we have the documentation's example of *Concrete Table Inheritance, *where session.query(Employee).all() produces this: SELECT pjoin.type AS pjoin_type, pjoin.manager_data AS pjoin_manager_data, pjoin.employee_id AS pjoin_employee_id, pjoin.name AS pjoin_name,