summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/ext/activemapper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py
index fa32a5fc3..9c4b29b22 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -88,7 +88,8 @@ class relationship(object):
relclass = ActiveMapperMeta.classes[self.classname]
if klass.__name__ == self.classname:
- br_fkey = getattr(relclass.c, self.colname)
+ class_mapper(relclass).compile()
+ br_fkey = relclass.c[self.colname]
else:
br_fkey = None