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 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 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 should not be.   in any case, you're
>> looking for an aggregate value (the lowest).  So without fetching many
>> rows, a subquery is unavoidable, though you have a choice whether you'd
>> like it correlated within the columns query (the normal way), or as an
>> additional selectable in the FROM clause (avoids correlation).
>> 
>>> 
>>> In the end I'd like the object to have a "saleprice" attribute (either
>>> column_property or, if possible, association_proxy) that is the single
>>> saleprice for the given date and store.
>>> 
>>> When using the association proxy, can I somehow specify the first item
>>> in the list?
>> 
>> no, if you truly wanted to retrieve the full list of related items and
>> display the price of the lowest, you'd use an ordinary method on your
>> class to do that.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To post to this group, send email to sqlalch...@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.
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To post to this group, send email to sqlalch...@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.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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.

Reply via email to