> Invasive.mapper.select_by(order_by=[invasivecategory.category])
> Invasive.mapper.select(order_by=[InvasiveCategory.c.category]) // This 
> query doesn't fail, but a JOIN is missing ... (why ?)

cascade_mappers creates a Lazy loader, ie: data from the second table are
only fetched when needed. You can use Eager loader if you want a join (OUTER
LEFT JOIN) and you can transform one into the other with mapper.options:

    eagermapper = lazymapper.options(eagerload('your_prop'))

there is no way to get order_by to work correctly if the
attribute on which you want to sort is in the secondary table, becouse of the
way the rowset is proposed (instances of the second table are appended to the
instances of the primary table)

You may want to read this message:
http://article.gmane.org/gmane.comp.python.sqlalchemy.user/1404/match=returned+values+mapper+select+rowset


I'd personally advocate an option to get a list of pointers to the
instances as they are retrieved from the db so that one could walk throught
it retaining the order they had.

sandro
*:-)

-- 
Sandro Dentella  *:-)
e-mail: [EMAIL PROTECTED] 
http://www.tksql.org                    TkSQL Home page - My GPL work


-------------------------------------------------------
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