Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8154: Added note to docs/db-api.txt indicating that reverse() …

…is only useful when the QuerySet has some prior ordering

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d8bfabe98d31299bfa24f71af47377495f360dae 1 parent 0c115f1
James Bennett authored August 15, 2008

Showing 1 changed file with 9 additions and 0 deletions. Show diff stats Hide diff stats

  1. 9  docs/db-api.txt
9  docs/db-api.txt
@@ -621,6 +621,15 @@ penultimate item and so on. If we had a Python sequence and looked at
621 621
 that mode of access (slicing from the end), because it's not possible to do it
622 622
 efficiently in SQL.
623 623
 
  624
+Also, note that ``reverse()`` should generally only be called on a
  625
+``QuerySet`` which has a defined ordering (e.g., when querying against
  626
+a model which defines a default ordering, or when using
  627
+``order_by()``). If no such ordering is defined for a given
  628
+``QuerySet``, calling ``reverse()`` on it has no real effect (the
  629
+ordering was undefined prior to calling ``reverse()``, and will remain
  630
+undefined afterward).
  631
+
  632
+
624 633
 ``distinct()``
625 634
 ~~~~~~~~~~~~~~
626 635
 

0 notes on commit d8bfabe

Please sign in to comment.
Something went wrong with that request. Please try again.