summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/activemapper.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ext/activemapper.py')
-rw-r--r--lib/sqlalchemy/ext/activemapper.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/activemapper.py b/lib/sqlalchemy/ext/activemapper.py
index 2a39fe970..b28ada0af 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -142,9 +142,9 @@ def process_relationships(klass, was_deferred=False):
# not able to find any of the related tables
if not defer:
for col in klass.columns:
- if col.foreign_key is not None:
+ if col.foreign_keys:
found = False
- cn = col.foreign_key._colspec
+ cn = col.foreign_keys[0]._colspec
table_name = cn[:cn.rindex('.')]
for other_klass in ActiveMapperMeta.classes.values():
if other_klass.table.fullname.lower() == table_name.lower():