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/dialects/postgresql/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index d779935ce..a9ff988e8 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -619,12 +619,12 @@ ischema_names = { class PGCompiler(compiler.SQLCompiler): - def visit_match_op(self, binary, **kw): + def visit_match_op_binary(self, binary, operator, **kw): return "%s @@ to_tsquery(%s)" % ( self.process(binary.left), self.process(binary.right)) - def visit_ilike_op(self, binary, **kw): + def visit_ilike_op_binary(self, binary, operator, **kw): escape = binary.modifiers.get("escape", None) return '%s ILIKE %s' % \ (self.process(binary.left), self.process(binary.right)) \ @@ -632,7 +632,7 @@ class PGCompiler(compiler.SQLCompiler): (' ESCAPE ' + self.render_literal_value(escape, None)) or '') - def visit_notilike_op(self, binary, **kw): + def visit_notilike_op_binary(self, binary, operator, **kw): escape = binary.modifiers.get("escape", None) return '%s NOT ILIKE %s' % \ (self.process(binary.left), self.process(binary.right)) \ -- cgit v1.2.1