Hi,

I'm building a nice query of polymorphically related tables similar to
the one in the docs

session.query(Employee.name).\
    outerjoin((engineer, engineer.c.employee_id==Employee.employee_id)).\
    outerjoin((manager, manager.c.employee_id==Employee.employee_id)).\
    filter(or_(Engineer.engineer_info=='w', Manager.manager_data=='q'))

now, my problem is that this includes all the columns of engineer and
manager into the subquery

SELECT board_owners.id AS board_owners_id
FROM board_owners LEFT OUTER JOIN (SELECT board_owners.id AS
board_owners_id, board_owners.type AS board_owners_type,
mb_user_owners.user_id AS mb_user_owners_user_id,
mb_user_owners.board_owner_id AS mb_user_owners_board_owner_id

FROM board_owners JOIN mb_user_owners ON board_owners.id =
mb_user_owners.board_owner_id) AS anon_1 ON
anon_1.mb_user_owners_board_owner_id = board_owners.id

how can I specify to ask for the name (or a specific column present
everywhere) only from every table?
(Actually, I don't need any data from the joined tables, I need them
only for filtering the results from the Employee table)

Viktor

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en.

Reply via email to