[SQL-CVS] r2751 - SQLObject/trunk/sqlobject/firebird
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2007-07-16 11:51:10
|
Author: phd
Date: 2007-07-16 05:51:07 -0600 (Mon, 16 Jul 2007)
New Revision: 2751
Modified:
SQLObject/trunk/sqlobject/firebird/firebirdconnection.py
Log:
Applied the patch 1744847: Firebird, fromDatabase generate 2 ID columns fix.
Modified: SQLObject/trunk/sqlobject/firebird/firebirdconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:50:43 UTC (rev 2750)
+++ SQLObject/trunk/sqlobject/firebird/firebirdconnection.py 2007-07-16 11:51:07 UTC (rev 2751)
@@ -192,11 +192,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))
|