From: Jason Kirtland Date: Mon, 27 Aug 2007 19:14:26 +0000 (+0000) Subject: Fixed signature for orm's BETWEEN operator. X-Git-Tag: rel_0_4beta6~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9c7a423f6c65f43caae6a0a17529f40218767cdd;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fixed signature for orm's BETWEEN operator. --- diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index b8aca3d26d..c1d2ebc874 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -29,8 +29,8 @@ def ilike_op(a, b): def notilike_op(a, b): raise NotImplementedError() -def between_op(a, b): - return a.between(b) +def between_op(a, b, c): + return a.between(b, c) def in_op(a, b): return a.in_(*b) diff --git a/test/orm/query.py b/test/orm/query.py index c7847b3211..b86c957c4d 100644 --- a/test/orm/query.py +++ b/test/orm/query.py @@ -193,8 +193,13 @@ class OperatorTest(QueryTest): fwd_sql + "'\n or\n'" + rev_sql + "'") def test_in(self): - self._test(User.id.in_('a', 'b'), "users.id IN (:users_id, :users_id_1)") - + self._test(User.id.in_('a', 'b'), + "users.id IN (:users_id, :users_id_1)") + + def test_between(self): + self._test(User.id.between('a', 'b'), + "users.id BETWEEN :users_id AND :users_id_1") + def test_clauses(self): for (expr, compare) in ( (func.max(User.id), "max(users.id)"),