On 5/30/2010 9:43 AM, Eric Lemoine wrote:
On Sun, May 30, 2010 at 4:39 PM, Eric Lemoine
<[email protected]>  wrote:
Hello

I use Pylons. Pylons does:

Session = scoped_session(sessionmaker())

and then:

Session.configure(bind=engine)

My question: with a reference to Session how can I get the engine
that's bound to it? I tried Session.get_bind() but I get this error:
"TypeError: get_bind() takes at least 2 arguments (1 given)".

Session.get_bind(mapper=None) seems to do the trick, but I'm not sure
this is the good way. Could someone confirm? Thanks again.
Not sure if this is proper, but I've always just used Session.bind. Then again I've really only used it when testing things out, because at runtime my engines are defined in such a way that I never need to "discover" them through the Session.

Lance

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to