ive liked __session__ all along. Dan's concern is that people will think __session__ returns the session which the instance is attached to, not just the "contextual" session which may be different.

In my original proposal, i was going to just have __session__ just return wahtever contextual session the developer wants, whether it be associated with a class, with an instance, whatever; I cannot predict what people might want to use it for. I guess your specific use case does require that different instances reference a different "contextual" session.

So what do you say Dan ?  can we just leave it open ended ?


On May 2, 2006, at 10:01 AM, Gustavo Niemeyer wrote:

how about 'contextualsession' or something....I really dislike the
name "contextsession".

__session__ would probably be fine, unless you're afraid to conflict
with something else. We use __int__ to get ints out of an object,
__nonzero__ to get a boolean, and so on. Using __session__ looks like
a reasonable way to get a session out of an object.

also i dont understand how sticking a __call__() on SessionContext
would have any impact on its existing get/set/del operations.

Daniel was probably talking about SessionContext.current. It may
be nice, but I don't think this interface should be *enforced*
anywhere by SA (and I don't think Daniel is suggesting it either).

I'd also like to see instances being queried for sessions. Daniel's
implementation of current_session(obj) is currently doing lookups
on classes only.  I've provided one potential implementation in a
message of this thread.

--
Gustavo Niemeyer
http://niemeyer.net


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



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