From: Mike Bayer Date: Mon, 28 Jan 2013 18:58:01 +0000 (-0500) Subject: - add full docs for like()/ilike() X-Git-Tag: rel_0_8_0~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7790425a993480e81605efc8a07fed13bcdd4841;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - add full docs for like()/ilike() --- diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index f233bf0fb7..10d01acd62 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -356,6 +356,20 @@ class ColumnOperators(Operators): In a column context, produces the clause ``a LIKE other``. + E.g.:: + + select([sometable]).where(sometable.c.column.like("%foobar%")) + + :param other: expression to be compared + :param escape: optional escape character, renders the ``ESCAPE`` + keyword, e.g.:: + + somecolumn.like("foo/%bar", escape="/") + + .. seealso:: + + :meth:`.ColumnOperators.ilike` + """ return self.operate(like_op, other, escape=escape) @@ -364,6 +378,20 @@ class ColumnOperators(Operators): In a column context, produces the clause ``a ILIKE other``. + E.g.:: + + select([sometable]).where(sometable.c.column.ilike("%foobar%")) + + :param other: expression to be compared + :param escape: optional escape character, renders the ``ESCAPE`` + keyword, e.g.:: + + somecolumn.ilike("foo/%bar", escape="/") + + .. seealso:: + + :meth:`.ColumnOperators.like` + """ return self.operate(ilike_op, other, escape=escape)