Hello, Any idea with the following query :
Session.query(Folder, Data). select_from(folder.join(content).outerjoin(data.select().alias('foo'))) why SQLAlchemy generates : SELECT ... FROM data, folder JOIN content ON content.id = folder.content_id LEFT OUTER JOIN (SELECT data.content_id AS content_id, data.mime_id AS mime_id, data.file_size AS file_size, data.name AS name FROM data) AS foo ON content.id = foo.content_id instead of SELECT ... FROM folder JOIN content ON content.id = folder.content_id LEFT OUTER JOIN (SELECT data.content_id AS content_id, data.mime_id AS mime_id, data.file_size AS file_size, data.name AS name FROM data) AS foo ON content.id = foo.content_id Is there a way to tell SQLAlchemy that it should map "Data" with the result from the subquery (foo) instead of adding the table in the FROM ? Thanks, Julien -- Julien Cigar Belgian Biodiversity Platform http://www.biodiversity.be Université Libre de Bruxelles (ULB) Campus de la Plaine CP 257 Bâtiment NO, Bureau 4 N4 115C (Niveau 4) Boulevard du Triomphe, entrée ULB 2 B-1050 Bruxelles Mail: jci...@ulb.ac.be @biobel: http://biobel.biodiversity.be/person/show/471 Tel : 02 650 57 52 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---