summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-03-13 15:40:25 -0400
committerTim Graham <timograham@gmail.com>2015-03-13 15:42:09 -0400
commitf8ed647435e13d62d4df0bbc76d37b91d0ad81fb (patch)
treec6c00122dd2fbe38b0774efef96eb993ba7fc78b
parent9bb451aedba9761eb78968183d21a7e27a7c7f1b (diff)
[1.7.x] Refs #24462 -- Emphasized that order_by() clears previous ordering.
Backport of b9d9ab23bdcc404708aada664e718a9d56415ca3 from master
-rw-r--r--docs/ref/models/querysets.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 612402461b..4946f7726e 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -348,6 +348,11 @@ You can tell if a query is ordered or not by checking the
:attr:`.QuerySet.ordered` attribute, which will be ``True`` if the
``QuerySet`` has been ordered in any way.
+Each ``order_by()`` call will clear any previous ordering. For example, this
+query will be ordered by ``pub_date`` and not ``headline``::
+
+ Entry.objects.order_by('headline').order_by('pub_date')
+
.. warning::
Ordering is not a free operation. Each field you add to the ordering