[SQL-CVS] r697 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2005-04-01 17:36:44
|
Author: ianb Date: 2005-04-01 17:36:23 +0000 (Fri, 01 Apr 2005) New Revision: 697 Modified: trunk/SQLObject/sqlobject/col.py Log: Two bugs: the class wasn't being tracked by the columns (!), and when creating foreign key constraints we weren't looking up the other class respecting its registry Modified: trunk/SQLObject/sqlobject/col.py =================================================================== --- trunk/SQLObject/sqlobject/col.py 2005-04-01 17:34:57 UTC (rev 696) +++ trunk/SQLObject/sqlobject/col.py 2005-04-01 17:36:23 UTC (rev 697) @@ -140,7 +140,7 @@ self.constraints = [consts.notNull] + self.constraints self.name = name - self.soClass = None + self.soClass = soClass self._default = default self.customSQLType = sqlType @@ -622,7 +622,8 @@ def postgresCreateSQL(self): sql = SOKeyCol.postgresCreateSQL(self) - other = findClass(self.foreignKey) + print [self, self.soClass] + other = findClass(self.foreignKey, self.soClass.sqlmeta.registry) tName = other.sqlmeta.table idName = other.sqlmeta.idName if self.cascade is not None: |