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 9c4b29b22..e5200e057 100644
--- a/lib/sqlalchemy/ext/activemapper.py
+++ b/lib/sqlalchemy/ext/activemapper.py
@@ -159,7 +159,8 @@ def process_relationships(klass, was_deferred=False):
for col in klass.columns:
if col.foreign_key is not None:
found = False
- table_name = col.foreign_key._colspec.rsplit('.', 1)[0]
+ cn = col.foreign_key._colspec
+ table_name = cn[:cn.rindex('.')]
for other_klass in ActiveMapperMeta.classes.values():
if other_klass.table.fullname.lower() == table_name.lower():
found = True