[SQL-CVS] r2749 - in SQLObject/branches/0.8: docs sqlobject/firebird
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2007-07-16 11:50:21
|
Author: phd Date: 2007-07-16 05:50:13 -0600 (Mon, 16 Jul 2007) New Revision: 2749 Modified: SQLObject/branches/0.8/docs/News.txt SQLObject/branches/0.8/sqlobject/firebird/firebirdconnection.py Log: Applied the patch 1744847: Firebird, fromDatabase generate 2 ID columns fix. Modified: SQLObject/branches/0.8/docs/News.txt =================================================================== --- SQLObject/branches/0.8/docs/News.txt 2007-07-16 11:49:04 UTC (rev 2748) +++ SQLObject/branches/0.8/docs/News.txt 2007-07-16 11:50:13 UTC (rev 2749) @@ -175,6 +175,8 @@ * MySQLConnection now recognizes Enum, Double and Time columns when drawing the database scheme from DB. +* Minor fix in FirebirdConnection.fromDatabase. + SQLObject 0.7.7 =============== Modified: SQLObject/branches/0.8/sqlobject/firebird/firebirdconnection.py =================================================================== --- SQLObject/branches/0.8/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:49:04 UTC (rev 2748) +++ SQLObject/branches/0.8/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:50:13 UTC (rev 2749) @@ -193,11 +193,13 @@ colData = self.queryAll(fieldqry % tableName.upper()) results = [] for field, t, flength, fscale, nullAllowed, thedefault, blobType in colData: - if field == 'id': + field = field.strip() + idName = str(soClass.sqlmeta.idName or 'id').upper() + if field.upper() == idName: continue colClass, kw = self.guessClass(t, flength, fscale) kw['name'] = soClass.sqlmeta.style.dbColumnToPythonAttr(field).strip() - kw['dbName'] = field.strip() + kw['dbName'] = field kw['notNone'] = not nullAllowed kw['default'] = thedefault results.append(colClass(**kw)) |