From b9d9ab23bdcc404708aada664e718a9d56415ca3 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 13 Mar 2015 15:40:25 -0400 Subject: [PATCH] Refs #24462 -- Emphasized that order_by() clears previous ordering. --- docs/ref/models/querysets.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 05de43fa1f..fdaa79540a 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -388,6 +388,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