Author: phd
Date: 2004-12-28 08:25:11 +0000 (Tue, 28 Dec 2004)
New Revision: 496
Modified:
home/phd/SQLObject/inheritance/sqlobject/dbconnection.py
Log:
Merged difference from revisions 493:495
Modified: home/phd/SQLObject/inheritance/sqlobject/dbconnection.py
===================================================================
--- home/phd/SQLObject/inheritance/sqlobject/dbconnection.py 2004-12-27 17:24:24 UTC (rev 495)
+++ home/phd/SQLObject/inheritance/sqlobject/dbconnection.py 2004-12-28 08:25:11 UTC (rev 496)
@@ -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)
|