[sqlalchemy] Can python objects be used in join logic?

2011-04-28 Thread Jennifer Rodriguez-Mueller
Hi all, I'm new to sqlalchemy. I've always tended to write SQL directly (exposing SQL results to python code using simple db interface libraries) and I'm still trying to wrap my head around the purpose, style, and proper idioms of ORM technology. This is mostly a cultural question I guess.

Re: [sqlalchemy] Can python objects be used in join logic?

2011-04-28 Thread Michael Bayer
On Apr 28, 2011, at 2:24 PM, Jennifer Rodriguez-Mueller wrote: Here is the core SQL (lots of distracting content trimmed): SELECT s.*, a.* FROM aliquot_table a JOIN ( -- Biologically (p)lausible aliquot/specimen type logic SELECT 3 AS a_type, 12 AS s_type UNION --

Re: [sqlalchemy] Can python objects be used in join logic?

2011-04-28 Thread Jennifer Rodriguez-Mueller
Thank you Michael, that makes things *much* clearer! I had been thinking of sqlalchemy as a database manipulation system that took inspiration from my source code, rather than thinking of a library that uses compiled but introspectively accessible bytecode with variable names preserved, so that