summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/expression.py7
-rw-r--r--lib/sqlalchemy/sql/operators.py3
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index fbef02857..c7ab34272 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -1049,7 +1049,12 @@ class Operators(object):
def __invert__(self):
return self.operate(operators.inv)
-
+
+ def op(self, opstring):
+ def op(b):
+ return self.operate(operators.op, opstring, b)
+ return op
+
def clause_element(self):
raise NotImplementedError()
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index 78159697b..4ee5f4a18 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -21,6 +21,9 @@ def is_():
def isnot():
raise NotImplementedError()
+def op(a, opstring, b):
+ return a.op(opstring)(b)
+
def like_op(a, b):
return a.like(b)