mirror of
https://github.com/django/django.git
synced 2025-03-31 03:30:46 +00:00
Fixed #31342 -- Clarified docs about using base managers for related objects.
This commit is contained in:
parent
7c8b043a03
commit
08a6215d33
@ -214,11 +214,13 @@ appropriate for your circumstances, you can tell Django which class to use by
|
|||||||
setting :attr:`Meta.base_manager_name
|
setting :attr:`Meta.base_manager_name
|
||||||
<django.db.models.Options.base_manager_name>`.
|
<django.db.models.Options.base_manager_name>`.
|
||||||
|
|
||||||
Base managers aren't used when querying on related models. For example, if the
|
Base managers aren't used when querying on related models, or when
|
||||||
``Question`` model :ref:`from the tutorial <creating-models>` had a ``deleted``
|
:ref:`accessing a one-to-many or many-to-many relationship
|
||||||
field and a base manager that filters out instances with ``deleted=True``, a
|
<backwards-related-objects>`. For example, if the ``Question`` model
|
||||||
queryset like ``Choice.objects.filter(question__name__startswith='What')``
|
:ref:`from the tutorial <creating-models>` had a ``deleted`` field and a base
|
||||||
would include choices related to deleted questions.
|
manager that filters out instances with ``deleted=True``, a queryset like
|
||||||
|
``Choice.objects.filter(question__name__startswith='What')`` would include
|
||||||
|
choices related to deleted questions.
|
||||||
|
|
||||||
Don't filter away any results in this type of manager subclass
|
Don't filter away any results in this type of manager subclass
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user