]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Small change in ActiveMapper to make it work with Python 2.3
authorPaul Johnston <paj@pajhome.org.uk>
Tue, 4 Sep 2007 22:31:50 +0000 (22:31 +0000)
committerPaul Johnston <paj@pajhome.org.uk>
Tue, 4 Sep 2007 22:31:50 +0000 (22:31 +0000)
lib/sqlalchemy/ext/activemapper.py

index 2fcf44f6155ec9bb300d1b8147c9af5f762bf9a1..35008e0241fa92c51aaa3cc09d00d0beb7a091d6 100644 (file)
@@ -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