On Apr 6, 2006, at 3:41 PM, dmiller wrote:


Does this mean I don't need to use mapper.using(...).select(...) to execute a query on a session anymore? i.e. I could do mapper.select (session=x, ...)

oh...well, I actually just committed "the big change", since after looking at the problem I could see numerous advantages to the Query object you proposed, including that the whole concept of "selecting" could be moved from the mapper module into its own module, since its a different kind of "lifting" than what the rest of Mapper does, and also the using() function is now a nice reasonable method that returns a new Query with the given session stored inside of it.

so I took the "session" keyword argument out for this revision....we can put it in but the thing I dont like about it is that most of the "query" methods dont have the room for arbitrary keyword arguments, such as select_by, get_by, count_by, select_statement, where the keyword arguments are either used to build the criterion or to specify the bind parameter values for a given statement....so it would be not quickly apparent to users which methods could take "session" and which could not.

although this time around you can do what I think maybe you wanted, which is just make your own Query objects with whatever session, i.e.

        q = Query(mapper, session=sess)

and youre off. we are not yet doing anything with the SQLEngines or connections being different, thats next.

take a look at sqlalchemy.mapping.query and youll see what I mean. this should be a generally more accessible place for people who want to screw around with how the mapper selects objects.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to