diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-15 19:05:23 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-11-15 19:05:23 -0500 |
commit | 20ad3b16e81ebbdb605ee06cf11610d2adb1ab8a (patch) | |
tree | 862ba4e68fb835eb685492572ae0992dde5ba6f4 /lib/sqlalchemy/orm/util.py | |
parent | 40d5a32e59a49075129211358f00e857dac73885 (diff) | |
download | sqlalchemy-20ad3b16e81ebbdb605ee06cf11610d2adb1ab8a.tar.gz |
[ticket:1966] implementation
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r-- | lib/sqlalchemy/orm/util.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py index db28089ef..ed0814e09 100644 --- a/lib/sqlalchemy/orm/util.py +++ b/lib/sqlalchemy/orm/util.py @@ -545,8 +545,8 @@ def _entity_info(entity, compile=True): else: return None, entity, False - if compile: - mapper = mapper.compile() + if compile and mapperlib.module._new_mappers: + mapperlib.configure_mappers() return mapper, mapper._with_polymorphic_selectable, False def _entity_descriptor(entity, key): @@ -619,8 +619,8 @@ def class_mapper(class_, compile=True): except exc.NO_STATE: raise exc.UnmappedClassError(class_) - if compile: - mapper = mapper.compile() + if compile and mapperlib.module._new_mappers: + mapperlib.configure_mappers() return mapper def _class_to_mapper(class_or_mapper, compile=True): @@ -638,10 +638,9 @@ def _class_to_mapper(class_or_mapper, compile=True): else: raise exc.UnmappedClassError(class_or_mapper) - if compile: - return mapper.compile() - else: - return mapper + if compile and mapperlib.module._new_mappers: + mapperlib.configure_mappers() + return mapper def has_identity(object): state = attributes.instance_state(object) |