[SQL-CVS] r495 - trunk/SQLObject/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sub...@co...> - 2004-12-27 17:24:27
|
Author: ianb Date: 2004-12-27 17:24:24 +0000 (Mon, 27 Dec 2004) New Revision: 495 Modified: trunk/SQLObject/sqlobject/dbconnection.py Log: Got rid of tabs. Bad tabs! Modified: trunk/SQLObject/sqlobject/dbconnection.py =================================================================== --- trunk/SQLObject/sqlobject/dbconnection.py 2004-12-24 09:28:53 UTC (rev 494) +++ trunk/SQLObject/sqlobject/dbconnection.py 2004-12-27 17:24:24 UTC (rev 495) @@ -442,22 +442,22 @@ self.sqlrepr(value)) for key, value in kw.items()]) - terms = [] - for key, value in kw.items(): - if hasattr(value, '_SO_joinDict'): #handle an object value - # find the joinColumn - for join in value._SO_joinDict.values(): - if join.otherClass is soClass: - dbName = join.joinColumn - break - else: #if nothing found - raise TypeError, "Cannot selectBy(%s=%r)" % (key, value) - value = value.id - else: - dbName = soClass._SO_columnDict[key].dbName - term = '%s = %s' % (dbName, self.sqlrepr(value)) - terms.append(term) - return ' AND '.join(terms) + terms = [] + for key, value in kw.items(): + if hasattr(value, '_SO_joinDict'): #handle an object value + # find the joinColumn + for join in value._SO_joinDict.values(): + if join.otherClass is soClass: + dbName = join.joinColumn + break + else: #if nothing found + raise TypeError, "Cannot selectBy(%s=%r)" % (key, value) + value = value.id + else: + dbName = soClass._SO_columnDict[key].dbName + term = '%s = %s' % (dbName, self.sqlrepr(value)) + terms.append(term) + return ' AND '.join(terms) def sqlrepr(self, v): return sqlrepr(v, self.dbName) |