[SQL-CVS] r1909 - SQLObject/branches/0.7-bugfix/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2006-09-06 14:47:09
|
Author: phd Date: 2006-09-06 08:47:06 -0600 (Wed, 06 Sep 2006) New Revision: 1909 Modified: SQLObject/branches/0.7-bugfix/sqlobject/main.py Log: No need to loop over the "columns" dictionary - "name" is exactly a key for the dictionary. Modified: SQLObject/branches/0.7-bugfix/sqlobject/main.py =================================================================== --- SQLObject/branches/0.7-bugfix/sqlobject/main.py 2006-09-06 14:46:32 UTC (rev 1908) +++ SQLObject/branches/0.7-bugfix/sqlobject/main.py 2006-09-06 14:47:06 UTC (rev 1909) @@ -1256,10 +1256,9 @@ def _findAlternateID(cls, name, dbName, value, connection=None): if isinstance(value, unicode): - for key, column in cls.sqlmeta.columns.items(): - if (key == name) and isinstance(column, col.SOUnicodeCol): - value = value.encode(column.dbEncoding) - break + column = cls.sqlmeta.columns[name] + if isinstance(column, col.SOUnicodeCol): + value = value.encode(column.dbEncoding) return (connection or cls._connection)._SO_selectOneAlt( cls, [cls.sqlmeta.idName] + |