From 15ea17d7f882fec3f892a22612da4827780c8dae Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Sun, 19 Dec 2010 19:25:33 -0500 Subject: Added NULLS FIRST and NULLS LAST support. It's implemented as an extension to the asc() and desc() operators, called nullsfirst() and nullslast(). [ticket:723] --- lib/sqlalchemy/sql/operators.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/sqlalchemy/sql/operators.py') diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py index 0577e6668..77916e80e 100644 --- a/lib/sqlalchemy/sql/operators.py +++ b/lib/sqlalchemy/sql/operators.py @@ -83,6 +83,12 @@ def desc_op(a): def asc_op(a): return a.asc() +def nullsfirst_op(a): + return a.nullsfirst() + +def nullslast_op(a): + return a.nullslast() + _commutative = set([eq, ne, add, mul]) def is_commutative(op): -- cgit v1.2.1