Bugs item #3536492, was opened at 2012-06-19 21:45
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3536492&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject release (specify)
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: je...@im... ()
Assigned to: Oleg Broytman (phd)
Summary: sqlbuilder.Select.filter does not filter, just replaces
Initial Comment:
def filter(self, filter_clause):
if filter_clause is None:
# None doesn't filter anything, it's just a no-op:
return self
clause = self.ops['clause']
if isinstance(clause, basestring):
clause = SQLConstant('(%s)' % clause)
if clause == SQLTrueClause: <---- always evaluates to true
newClause = filter_clause
else:
newClause = AND(clause, filter_clause)
return self.newClause(newClause)
if clause == SQLTrueClause always evaluates to true so the clause is never ANDed just replaced which means filter is useless.
SQLExpression.__eq__ returns an SQLOp which evalutes to true.
Removing this conditional statement works as expected since ANDing with a true clause will work as one expects.
----------------------------------------------------------------------
>Comment By: Oleg Broytman (phd)
Date: 2012-06-24 05:20
Message:
Fixed in the revisions 4545-4547 (branches 1.2, 1.3 and the trunk). Thank
you!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=3536492&group_id=74338
|