Author: phd
Date: 2007-07-16 05:50:43 -0600 (Mon, 16 Jul 2007)
New Revision: 2750
Modified:
SQLObject/branches/0.9/docs/News.txt
SQLObject/branches/0.9/sqlobject/firebird/firebirdconnection.py
Log:
Applied the patch 1744847: Firebird, fromDatabase generate 2 ID columns fix.
Modified: SQLObject/branches/0.9/docs/News.txt
===================================================================
--- SQLObject/branches/0.9/docs/News.txt 2007-07-16 11:50:13 UTC (rev 2749)
+++ SQLObject/branches/0.9/docs/News.txt 2007-07-16 11:50:43 UTC (rev 2750)
@@ -240,6 +240,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.9/sqlobject/firebird/firebirdconnection.py
===================================================================
--- SQLObject/branches/0.9/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:50:13 UTC (rev 2749)
+++ SQLObject/branches/0.9/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:50:43 UTC (rev 2750)
@@ -191,11 +191,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))
|