diff options
author | Michael Trier <mtrier@gmail.com> | 2010-12-19 19:25:33 -0500 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2010-12-19 19:25:33 -0500 |
commit | 15ea17d7f882fec3f892a22612da4827780c8dae (patch) | |
tree | 95470fa103945fecc63ce28045be46e1e5f61c1d /lib/sqlalchemy/sql/operators.py | |
parent | 0e8112d32290382b1b38f84bb254543a533ae995 (diff) | |
download | sqlalchemy-15ea17d7f882fec3f892a22612da4827780c8dae.tar.gz |
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]
Diffstat (limited to 'lib/sqlalchemy/sql/operators.py')
-rw-r--r-- | lib/sqlalchemy/sql/operators.py | 6 |
1 files changed, 6 insertions, 0 deletions
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): |