diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-28 19:07:56 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-10-28 19:07:56 -0400 |
commit | fb10b94e710a531203b73bd440aa149e18e3d06d (patch) | |
tree | ade43c52ccd3bee851730da435529b0e91a26a82 /lib/sqlalchemy/orm/util.py | |
parent | a13812606cc49909eb0bdceccfd899359e098ca2 (diff) | |
download | sqlalchemy-fb10b94e710a531203b73bd440aa149e18e3d06d.tar.gz |
- do a straight __subclasses__ traversal here, so that we aren't
iterating through all mappers in memory when a new event is tacked
onto an unmapped superclass, also removes the strong ref that was
breaking some GC teardown tests
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index dfa3ef852..43632ff13 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -932,7 +932,6 @@ def _attr_as_key(attr): else: return expression._column_as_key(attr) - _state_mapper = util.dottedgetter('manager.mapper') @inspection._inspects(object) @@ -950,6 +949,8 @@ def _inspect_mapped_object(instance): def _inspect_mapped_class(class_, configure=False): try: class_manager = attributes.manager_of_class(class_) + if not class_manager.is_mapped: + return None mapper = class_manager.mapper if configure and mapperlib.module._new_mappers: mapperlib.configure_mappers() |