Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Claudio Freire
On Mon, Jul 15, 2013 at 8:02 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 15, 2013, at 4:51 PM, Amir Elaguizy aelag...@gmail.com wrote: I'm having this weird problem using the query caching recipes in which two instances of a model representing the same underlying dataset will

Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Michael Bayer
On Jul 16, 2013, at 1:47 PM, Claudio Freire klaussfre...@gmail.com wrote: On Mon, Jul 15, 2013 at 8:02 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 15, 2013, at 4:51 PM, Amir Elaguizy aelag...@gmail.com wrote: I'm having this weird problem using the query caching recipes in

Re: [sqlalchemy] Query caching allows two objects representing same underlying data in session?

2013-07-16 Thread Claudio Freire
On Tue, Jul 16, 2013 at 4:22 PM, Michael Bayer mike...@zzzcomputing.com wrote: To put a cached instance into a session, you must first copy it, then update. How to do that, is very application-specific, and I don't think it can be automated. that's what merge(don't_load=True) does. If

[sqlalchemy] unregister mapper event

2013-07-16 Thread Greg Yang
Is it possible to remove mapper events? Specifically I want to call event.remove(mapper, 'mapper_configured', fn) but I get an error back saying Mapper is not iterable. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this

Re: [sqlalchemy] unregister mapper event

2013-07-16 Thread Michael Bayer
It's an unimplemented TODO right now.There are ways to remove the events through non-public means, but for it to be done correctly in all cases, there are lots of twists and turns that need to be managed (such as, unregistering an event on an abstract base, an event that has propagate=True,