[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-20 Thread Michael Bayer
Gaetan de Menten wrote: Since I was curious about the reason this didn't work, I looked more closely at that part of the code and I don't like that __new__ trick: it doesn't really help simplify the code and can be surprising. Attached patch suppress it. thank you, this is committed in

[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-16 Thread Iwan
Hi Gaetan, On Oct 14, 5:11 pm, Gaetan de Menten gdemen...@gmail.com wrote: On Wed, Oct 14, 2009 at 17:09, Gaetan de Menten gdemen...@gmail.com wrote: Btw: Iwan, did you try: factory = elixir.session.session_factory elixir.session.registry = sqlalchemy.util.ScopedRegistry(factory,

[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-14 Thread Gaetan de Menten
On Tue, Oct 13, 2009 at 16:49, Michael Bayer mike...@zzzcomputing.com wrote: We have a situation where we have an existing ScopedSession, but want to change its scopefunc.  This sounds like a strange requirement, it is because we use elixir - the issue is discusses here:

[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-14 Thread Gaetan de Menten
On Wed, Oct 14, 2009 at 17:09, Gaetan de Menten gdemen...@gmail.com wrote: Btw: Iwan, did you try: factory = elixir.session.session_factory elixir.session.registry = sqlalchemy.util.ScopedRegistry(maker, scope_func=your_scope_func) Of course, that should read : factory =

[sqlalchemy] Re: Modifying the scopefunc of an existing ScopedSession

2009-10-13 Thread Michael Bayer
Iwan wrote: Hi there, We have a situation where we have an existing ScopedSession, but want to change its scopefunc. This sounds like a strange requirement, it is because we use elixir - the issue is discusses here: