hooo boy. how can we do that one ? i dont think i can overload those operators....heres a variety of semi ugly ideas:

        table.c.foo.op("/", 100)
        catalog.c.unit_price.op("*", catalog.c.qty)

        table.c.foo.div(100)
        catalog.c.unit_price.times(catalog.c.qty)

this one might be more consistent with other operators:

        multiply(catalog.c.unit_price, catalog.c.qty)

I just wonder how many operators we'd have to add to fully support that kind of thing.

On Nov 29, 2005, at 11:14 PM, Robert Leftwich wrote:

Are there any options for using calculated columns in both the mapping and non-mapping sides of SQLAlchemy beyond using textual queries in situations ranging from the simple 'select foo/100...' through the classical 'select unit_price*qty...' ?

Robert




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to