Skip to content

Commit a4a250a

Browse files
committed
Corrected explanation of values() and extra() interaction in querysets.
Fixes #15546, refs #13455. The original documentation patch inadvertently muddied the waters in one aspect and this commit tidies that up. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent e0ae9db commit a4a250a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/ref/models/querysets.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,11 @@ A few subtleties that are worth mentioning:
436436
ordering can affect the results. See the note in :meth:`distinct` for
437437
details.
438438

439-
* If you use a ``values()`` clause after an ``extra()`` clause,
440-
any fields defined by a ``select`` argument in the ``extra()``
441-
must be explicitly included in the ``values()`` clause. However,
442-
if the ``extra()`` clause is used after the ``values()``, the
443-
fields added by the select will be included automatically.
439+
* If you use a ``values()`` clause after an :py:meth:`extra()` call,
440+
any fields defined by a ``select`` argument in the :py:meth:`extra()`
441+
must be explicitly included in the ``values()`` call. Any
442+
:py:meth:`extra()` call made after a ``values()`` call with have its
443+
extra selected fields ignored.
444444

445445
A ``ValuesQuerySet`` is useful when you know you're only going to need values
446446
from a small number of the available fields and you won't need the

0 commit comments

Comments
 (0)