#34337: Documentation for custom related managers is contradictory
-----------------------------------------+------------------------
               Reporter:  Adam Alton     |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Documentation  |        Version:  4.1
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 In the [section of the "Managers" documenation about base
 
managers](https://docs.djangoproject.com/en/4.1/topics/db/managers/#django.db.models.Model._base_manager),
 it says:

 > By default, Django uses an instance of the Model._base_manager manager
 class when accessing related objects

 and then two paragraphs further down it says:

 > Base managers aren’t used when querying on related models

 What? So Django uses a base manager for related objects, but base managers
 aren't used for related objects?! I checked with a colleague and they
 couldn't make sense of it either.

 It's unclear how to specify a custom manager which would be used for
 related object lookups. The section above about default managers doesn't
 give any clarifcation either.

 I seem to remember that there used to be an attribute on the `Manager`
 class called `use_for_related_objects`, but looking in the Django source
 code I can't see any reference to that anymore.

 I would open a pull request to update the docs, but I'm genuinely not sure
 what the behaviour is!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34337>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701864b4a5719-453e349b-d7c5-4c3a-aa2b-03684d4a530a-000000%40eu-central-1.amazonses.com.

Reply via email to