diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-29 18:50:18 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-29 18:57:04 -0400 |
| commit | fb647e5219a87cf15c026711ba0943ba3a080316 (patch) | |
| tree | 006eca5418ce1a56d65457bc944ad939698afcd7 /lib/sqlalchemy/orm/query.py | |
| parent | 05f28ba2fb6b9fe1e36748bb16969afc8375a9fb (diff) | |
| download | sqlalchemy-fb647e5219a87cf15c026711ba0943ba3a080316.tar.gz | |
Clarify order_by(False)
It wasn't clear how this differs from order_by(None);
add more tests and document that this has to do with whether or
not mapper.order_by will be re-enabled as well.
Change-Id: I332e8ac60c999b38c5a243f1cb72de3cf77891b6
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
| -rw-r--r-- | lib/sqlalchemy/orm/query.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index c5ecbaffe..f15f4340b 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1523,17 +1523,16 @@ class Query(object): passing ``None`` - this will suppress any ORDER BY configured on mappers as well. - Alternatively, an existing ORDER BY setting on the Query - object can be entirely cancelled by passing ``False`` - as the value - use this before calling methods where - an ORDER BY is invalid. + Alternatively, passing False will reset ORDER BY and additionally + re-allow default mapper.order_by to take place. Note mapper.order_by + is deprecated. """ if len(criterion) == 1: if criterion[0] is False: if '_order_by' in self.__dict__: - del self._order_by + self._order_by = False return if criterion[0] is None: self._order_by = None |
