extlist.add(ext_class)
else:
extlist.add(ext_class())
-
+ # local MapperExtensions have already instrumented the class
+ extlist[-1].instrument_class(self, self.class_)
+
extension = self.extension
if extension is not None:
for ext_obj in util.to_list(extension):
self.extension = ExtensionCarrier()
for ext in extlist:
self.extension.append(ext)
-
- self.extension.instrument_class(self, self.class_)
def _compile_inheritance(self):
"""Determine if this Mapper inherits from another mapper, and
finally:
_COMPILE_MUTEX.release()
+ for ext in util.to_list(self.extension, []):
+ ext.instrument_class(self, self.class_)
+
if self.entity_name is None:
self.class_.c = self.c
sso = SomeOtherObject.query().first()
assert SomeObject.query.filter_by(id=1).one().options[0].id == sso.id
+ def test_query_compiles(self):
+ class Foo(object):
+ pass
+ Session.mapper(Foo, table2)
+ assert hasattr(Foo, 'query')
+
def test_validating_constructor(self):
s2 = SomeObject(someid=12)
s3 = SomeOtherObject(someid=123, bogus=345)