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:
Tim Graham 2013-05-30 11:05:42 -04:00
parent 616f3c4a79
commit 5074c75a37
4 changed files with 21 additions and 1 deletions

View file

@ -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