#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+--------------------
     Reporter:  isbadawi       |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Documentation  |    Version:  1.7
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 This is a tiny thing I came across. The docs for
 [https://docs.djangoproject.com/en/1.7/ref/class-based-views/mixins-
 single-object/#django.views.generic.detail.SingleObjectMixin.model
 SingleObjectMixin.model] and [https://docs.djangoproject.com/en/1.7/ref
 /class-based-views/mixins-multiple-
 object/#django.views.generic.list.MultipleObjectMixin.model
 MultipleObjectMixin.model] both say:

 > The model that this view will display data for. Specifying `model = Foo`
 is effectively the same as specifying `queryset = Foo.objects.all()`.

 But peeking at the code, this isn't quite true -- in both cases
 
([https://github.com/django/django/blob/8c581ff39475c1b3b25d60945cc1c73a7f8eb1be/django/views/generic/detail.py#L67-L68
 here] and
 
[https://github.com/django/django/blob/8c581ff39475c1b3b25d60945cc1c73a7f8eb1be/django/views/generic/list.py#L37-L38
 here]), the default manager is used, which is not necessarily `objects`.

 Is it worth making this more precise? The docs don't mention default
 managers very often.

--
Ticket URL: <https://code.djangoproject.com/ticket/23597>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.9d2f8e88d096564ce4bb20ed11f60070%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to