summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/expression.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-08-14 13:47:58 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-08-14 13:47:58 -0400
commit05864ab8a6883cd286f27a05f045ef41a7327fcd (patch)
tree5bda84a6028168f0d0c6edf5a1f12df214acf095 /lib/sqlalchemy/sql/expression.py
parent7ce34c2b34d7122f6972eaf900ba988c19a0bb98 (diff)
downloadsqlalchemy-05864ab8a6883cd286f27a05f045ef41a7327fcd.tar.gz
- 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.
Diffstat (limited to 'lib/sqlalchemy/sql/expression.py')
-rw-r--r--lib/sqlalchemy/sql/expression.py8
1 files changed, 8 insertions, 0 deletions
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,