From d9b5991f9c21836e1d48555b949a402fc4ce6b35 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 13 Aug 2012 14:37:58 -0400 Subject: - develop new system of applying custom operators to ColumnElement classes. resembles that of the ORM so far. --- lib/sqlalchemy/sql/operators.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/sql/operators.py') diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 89681fa6a..f851a5b00 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -176,6 +176,10 @@ class custom_op(object): self.opstring = opstring self.precedence = precedence + def __eq__(self, other): + return isinstance(other, custom_op) and \ + other.opstring == self.opstring + def __call__(self, left, right, **kw): return left.operate(self, right, **kw) -- cgit v1.2.1