[sqlalchemy] Re: passing arguments to complicated columns

2010-04-01 Thread Kent
I believe (correct me if you know better) that an line subquery is quite a bit less efficient than a join. That was my motivation for avoiding that because there are so many rows and we've already seen performance problems with our queries... In the end I'd like the object to have a saleprice

[sqlalchemy] Re: passing arguments to complicated columns

2010-04-01 Thread Kent
in my example, I'd like to be able to say session.query(Product).get('SKUA').saleprice and get 32.99 as a result if user_store() function returns a 'EAST' and today is 01-Apr-2009 I probably should mention that it is even slightly more complicated... if there is no row selected from the

Re: [sqlalchemy] Re: passing arguments to complicated columns

2010-04-01 Thread Michael Bayer
Kent wrote: I believe (correct me if you know better) that an line subquery is quite a bit less efficient than a join. That was my motivation for avoiding that because there are so many rows and we've already seen performance problems with our queries... with a high quality planner, it

Re: [sqlalchemy] Re: passing arguments to complicated columns

2010-04-01 Thread Kent Bower
Thanks for the info. Still wondering, is there a way to tell the orm (a join criterion or a binary expression) use this function to find the param for the bind? On Apr 1, 2010, at 6:11 PM, Michael Bayer mike...@zzzcomputing.com wrote: Kent wrote: I believe (correct me if you know

Re: [sqlalchemy] Re: passing arguments to complicated columns

2010-04-01 Thread Michael Bayer
you can pass a lambda as the value for a bindparam() and it will be called at compile time. On Apr 1, 2010, at 6:34 PM, Kent Bower wrote: Thanks for the info. Still wondering, is there a way to tell the orm (a join criterion or a binary expression) use this function to find the param for