On May 11, 2006, at 12:54 PM, HD Mail wrote:

This seems to facilitate a much more flexible style of building select statements, rather then passing these things as parameters.
It would be nice to make the select() also using this style.
so building selects can be

s = select([users])
if order_by_address:
   s.order_by(addresstable.c.address)
else:
   s.order_by(user.c.id)
s.limit(5)
curs = s.execute()


when you use the SelectResults extension, the select() method also has the same behavior (except for the execute part).

Do we really want to use that slicing [] syntax though ? I tend to switch to SQL mode when writing queries in SA, so SQL keyword functions like order_by, limit(limit, offset=None), having(), for_update() etc. would make much more sense. Using specific python syntax for this single case just feels inconsistent.


well the extension is totally based on the similar functionality in SQLObject and i think the LIMIT/OFFSET part of it is something people look for as well. But you can mix and match both styles using select (), in fact. how un-pythonic (as usual).

Just MO so feel free to ignore.


i never ignore anything !  (intentionally)




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to