]> 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:35:00 +0000 (22:35 +0000)
committerPaul Johnston <paj@pajhome.org.uk>
Tue, 4 Sep 2007 22:35:00 +0000 (22:35 +0000)
lib/sqlalchemy/ext/activemapper.py

index 9c4b29b22426fb25cd86db67564df34587ab6be6..e5200e05784cc3c977ccf96cb41fb288a50e8eef 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