On Mar 10, 2012, at 11:45 AM, Andrey Popp wrote: > On Mon, Mar 05, 2012 at 04:52:36PM -0500, Michael Bayer wrote: >> Wow, OK great, you were able to make something work while maintaining the >> ClassManager approach. >> >> So the first thing is, you can skip the redefinition of Mapper(). You can >> put your custom ClassManager class right on a base or mixin class like this: >> >> class MySpecialMixin(object): __sa_instrumentation_manager__ = >> MySpecialClassManager > > I would be happy to do so, but is there any way I can do same w/o polluting > class's __dict__? What about adding argument to Mapper.__init__?
Hm yeah I suppose we can make that an option, sure! > >> The next thing is, you could also instead subclass InstrumentationManager >> instead of ClassManager, which provides hooks that are a bit more public. >> I'd probably need to add some more hooks to it in order to fulfill this use >> case, though. If you look through instrumentation.py >> _ClassInstrumentationAdapter you can see what that adaption looks like. > > Yeah, I should have use it instead. this approach might have more overhead, though. I like your approach too. The InstrumentationManager stuff was kind of a one off to support some PJE stuff. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.