Re: [sqlalchemy] passing parameters to subquery in mapped select

2011-10-14 Thread Michael Bayer
On Oct 14, 2011, at 10:56 AM, Burak Arslan wrote: On 10/14/11 06:40, Michael Bayer wrote: its a little awkward but if you use bindparam() in the inner select, query.params() can access those parameters just fine, you'd just need to use it in all cases. there's some related example of

Re: [sqlalchemy] passing parameters to subquery in mapped select

2011-10-14 Thread Burak Arslan
On 10/14/11 18:01, Michael Bayer wrote: On Oct 14, 2011, at 10:56 AM, Burak Arslan wrote: On 10/14/11 06:40, Michael Bayer wrote: its a little awkward but if you use bindparam() in the inner select, query.params() can access those parameters just fine, you'd just need to use it in all

[sqlalchemy] passing parameters to subquery in mapped select

2011-10-13 Thread Burak Arslan
hi, is there a way to pass a parameter to a subquery inside a select mapped to a class? the generated query looks like this: select * from ( select distinct on (some_table.id) some_table.id, ... from some_table where some_condition ) as v join ... the outer select is mapped to a class, but

Re: [sqlalchemy] passing parameters to subquery in mapped select

2011-10-13 Thread Michael Bayer
its a little awkward but if you use bindparam() in the inner select, query.params() can access those parameters just fine, you'd just need to use it in all cases. there's some related example of doing this with a relationship at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/GlobalFilter .