mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
0c115f12d7
commit
d8bfabe98d
|
@ -621,6 +621,15 @@ penultimate item and so on. If we had a Python sequence and looked at
|
||||||
that mode of access (slicing from the end), because it's not possible to do it
|
that mode of access (slicing from the end), because it's not possible to do it
|
||||||
efficiently in SQL.
|
efficiently in SQL.
|
||||||
|
|
||||||
|
Also, note that ``reverse()`` should generally only be called on a
|
||||||
|
``QuerySet`` which has a defined ordering (e.g., when querying against
|
||||||
|
a model which defines a default ordering, or when using
|
||||||
|
``order_by()``). If no such ordering is defined for a given
|
||||||
|
``QuerySet``, calling ``reverse()`` on it has no real effect (the
|
||||||
|
ordering was undefined prior to calling ``reverse()``, and will remain
|
||||||
|
undefined afterward).
|
||||||
|
|
||||||
|
|
||||||
``distinct()``
|
``distinct()``
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue