From 05864ab8a6883cd286f27a05f045ef41a7327fcd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 14 Aug 2012 13:47:58 -0400 Subject: - fix concat() operator, tests - [feature] Custom unary operators can now be used by combining operators.custom_op() with UnaryExpression(). - clean up the operator dispatch system and make it more consistent. This does change the compiler contract for custom ops. --- lib/sqlalchemy/sql/expression.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/sqlalchemy/sql/expression.py') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 6021b40b1..31e24e564 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2057,6 +2057,7 @@ class _DefaultColumnComparator(ColumnOperators): "mod": (__operate,), "truediv": (__operate,), "custom_op": (__operate,), + "concat_op": (__operate,), "lt": (__compare, operators.ge), "le": (__compare, operators.gt), "ne": (__compare, operators.eq), @@ -3475,7 +3476,14 @@ class Extract(ColumnElement): class UnaryExpression(ColumnElement): + """Define a 'unary' expression. + A unary expression has a single column expression + and an operator. The operator can be placed on the left + (where it is called the 'operator') or right (where it is called the + 'modifier') of the column expression. + + """ __visit_name__ = 'unary' def __init__(self, element, operator=None, modifier=None, -- cgit v1.2.1