[SQL-CVS] r1349 - SQLObject/trunk/sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2005-12-06 16:45:45
|
Author: phd
Date: 2005-12-06 16:45:39 +0000 (Tue, 06 Dec 2005)
New Revision: 1349
Modified:
SQLObject/trunk/sqlobject/joins.py
Log:
A patch by Randall Smith <ra...@tn...> to fix .select().filter().
Modified: SQLObject/trunk/sqlobject/joins.py
===================================================================
--- SQLObject/trunk/sqlobject/joins.py 2005-12-05 19:38:20 UTC (rev 1348)
+++ SQLObject/trunk/sqlobject/joins.py 2005-12-06 16:45:39 UTC (rev 1349)
@@ -224,15 +224,18 @@
'otherCol' : self.otherColumn,
'idValue' : inst.id,
}
- results = self.otherClass.select('''\
+ clause = '''\
%(otherTable)s.%(otherID)s = %(interTable)s.%(otherCol)s and
%(interTable)s.%(joinCol)s = %(table)s.%(ID)s and
-%(table)s.%(ID)s = %(idValue)s''' % options, clauseTables=(
- options['table'],
- options['otherTable'],
- options['interTable'],
- ))
- # TODO (michelts), apply order by on the selection
+%(table)s.%(ID)s = %(idValue)s''' % options
+ results = self.otherClass.select(sqlbuilder.SQLConstant(clause),
+ clauseTables=(
+ options['table'],
+ options['otherTable'],
+ options['interTable'],
+ )
+ )
+ # TODO (michelts): apply orderBy on the selection
return results
class SQLRelatedJoin(RelatedJoin):
|