From 0cc04e6e1b70abc4817f275a898aa063da3de007 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 19 Mar 2008 19:35:42 +0000 Subject: - like() and ilike() take an optional keyword argument "escape=", which is set as the escape character using the syntax "x LIKE y ESCAPE ''" [ticket:993] --- lib/sqlalchemy/sql/operators.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/sqlalchemy/sql/operators.py') diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index e31d27075..13f5e6131 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -25,16 +25,16 @@ def isnot(): def op(a, opstring, b): return a.op(opstring)(b) -def like_op(a, b): - return a.like(b) +def like_op(a, b, escape=None): + return a.like(b, escape=escape) -def notlike_op(a, b): +def notlike_op(a, b, escape=None): raise NotImplementedError() -def ilike_op(a, b): - return a.ilike(b) +def ilike_op(a, b, escape=None): + return a.ilike(b, escape=escape) -def notilike_op(a, b): +def notilike_op(a, b, escape=None): raise NotImplementedError() def between_op(a, b, c): -- cgit v1.2.1