summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/descriptor_props.py8
-rw-r--r--lib/sqlalchemy/testing/fixtures.py5
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/descriptor_props.py b/lib/sqlalchemy/orm/descriptor_props.py
index 3be5502ce..f22dd15c7 100644
--- a/lib/sqlalchemy/orm/descriptor_props.py
+++ b/lib/sqlalchemy/orm/descriptor_props.py
@@ -31,6 +31,8 @@ class DescriptorProperty(MapperProperty):
doc = None
+ uses_objects = False
+
def instrument_class(self, mapper):
prop = self
@@ -41,7 +43,7 @@ class DescriptorProperty(MapperProperty):
@property
def uses_objects(self):
- return getattr(mapper.class_, prop.name).impl.uses_objects
+ return prop.uses_objects
def __init__(self, key):
self.key = key
@@ -637,6 +639,10 @@ class SynonymProperty(DescriptorProperty):
util.set_creation_order(self)
+ @property
+ def uses_objects(self):
+ return getattr(self.parent.class_, self.name).impl.uses_objects
+
# TODO: when initialized, check _proxied_property,
# emit a warning if its not a column-based property
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index e2237fb17..04d09f8dd 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -388,7 +388,10 @@ class DeclarativeMappedTest(MappedTest):
cls=DeclarativeBasic,
)
cls.DeclarativeBasic = _DeclBase
- fn()
+
+ # sets up cls.Basic which is helpful for things like composite
+ # classes
+ super(DeclarativeMappedTest, cls)._with_register_classes(fn)
if cls.metadata.tables and cls.run_create_tables:
cls.metadata.create_all(config.db)