def filter(self, filter_clause):
if filter_clause is None:
# None doesn't filter anything, it's just a no-op:
clause = self.ops['clause']
if isinstance(clause, basestring):
clause = SQLConstant('(%s)' % clause)
if clause == SQLTrueClause: <---- always evaluates to true
newClause = filter_clause
newClause = AND(clause, filter_clause)
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.
Log in to post a comment.