summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/operators.py
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2010-12-19 19:25:33 -0500
committerMichael Trier <mtrier@gmail.com>2010-12-19 19:25:33 -0500
commit15ea17d7f882fec3f892a22612da4827780c8dae (patch)
tree95470fa103945fecc63ce28045be46e1e5f61c1d /lib/sqlalchemy/sql/operators.py
parent0e8112d32290382b1b38f84bb254543a533ae995 (diff)
downloadsqlalchemy-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.py6
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):