On Wednesday, June 27, 2012 1:59:38 PM UTC+2, Michael Bayer wrote: > > > All of this points towards not needing to recreate the entirety of > mappings. Really if you just need subclassing where the subclasses can be > thrown away, the patch + usage in www.sqlalchemy.org/trac/ticket/2526achieves > this. in fact, even without the patch, if you had a subclass of > a mapped class and wanted to discard it, you could say: > > MyBaseClass.__mapper__._inheriting_mappers.remove(MySubClass.__mapper__) > del MyBaseClass.__mapper__.polymorphic_map["mysubclass"] > MyBaseClass.__mapper__._expire_memoizations() > > it's that _expire_memoizations() part that is difficult to make automatic, > as it refers to an array of attributes on the mapper() object that are > lazily evaluated and then memoized. If you aren't using polymorphic > loading for these mappers, then even the above steps might not even be > needed - the additional records in these collections might just be > ignorable and would only be present while tests are running, not while the > actual app runs. > > Ok, I understand why you favoured that solution. We have implemented what you said above and it works fine. Will keep an eye on #2526 to see what you decide about that...
Thank you -i -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/Z1NK6EhtG58J. 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.
