mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #16856 - Added a way to clear select_related.
Thanks Carl for the suggestion and David Cramer for the patch.
This commit is contained in:
parent
616f3c4a79
commit
5074c75a37
4 changed files with 21 additions and 1 deletions
|
@ -774,6 +774,13 @@ You can also refer to the reverse direction of a
|
|||
is defined. Instead of specifying the field name, use the :attr:`related_name
|
||||
<django.db.models.ForeignKey.related_name>` for the field on the related object.
|
||||
|
||||
.. versionadded:: 1.6
|
||||
|
||||
If you need to clear the list of related fields added by past calls of
|
||||
``select_related`` on a ``QuerySet``, you can pass ``None`` as a parameter::
|
||||
|
||||
>>> without_relations = queryset.select_related(None)
|
||||
|
||||
.. deprecated:: 1.5
|
||||
The ``depth`` parameter to ``select_related()`` has been deprecated. You
|
||||
should replace it with the use of the ``(*fields)`` listing specific
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue