mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.11.x] Fixed #28561 -- Removed inaccurate docs about QuerySet.order_by() and joins.
As ofccbba98131, both examples don't use a join. Backport of44a6c27fd4from master
This commit is contained in:
@@ -312,15 +312,6 @@ identical to::
|
|||||||
|
|
||||||
Entry.objects.order_by('blog__name')
|
Entry.objects.order_by('blog__name')
|
||||||
|
|
||||||
It is also possible to order a queryset by a related field, without incurring
|
|
||||||
the cost of a JOIN, by referring to the ``_id`` of the related field::
|
|
||||||
|
|
||||||
# No Join
|
|
||||||
Entry.objects.order_by('blog_id')
|
|
||||||
|
|
||||||
# Join
|
|
||||||
Entry.objects.order_by('blog__id')
|
|
||||||
|
|
||||||
You can also order by :doc:`query expressions </ref/models/expressions>` by
|
You can also order by :doc:`query expressions </ref/models/expressions>` by
|
||||||
calling ``asc()`` or ``desc()`` on the expression::
|
calling ``asc()`` or ``desc()`` on the expression::
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user