[Django] #23597: docs: specifying SingleObjectMixin.model uses default manager, not necessarily objects

10 views
Skip to first unread message

Django

unread,
Oct 3, 2014, 5:46:05 PM10/3/14
to django-...@googlegroups.com
#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.

Django

unread,
Oct 4, 2014, 8:17:17 AM10/4/14
to django-...@googlegroups.com
#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 | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* easy: 0 => 1
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:1>

Django

unread,
Oct 4, 2014, 9:15:00 PM10/4/14
to django-...@googlegroups.com
#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+------------------------------------
Reporter: isbadawi | Owner: isbadawi
Type: Bug | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by isbadawi):

* status: new => assigned
* owner: nobody => isbadawi


--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:2>

Django

unread,
Oct 4, 2014, 9:37:14 PM10/4/14
to django-...@googlegroups.com
#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+------------------------------------
Reporter: isbadawi | Owner: isbadawi
Type: Bug | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by isbadawi):

* has_patch: 0 => 1


Comment:

Pull request: https://github.com/django/django/pull/3309

--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:3>

Django

unread,
Oct 6, 2014, 8:24:12 AM10/6/14
to django-...@googlegroups.com
#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+------------------------------------
Reporter: isbadawi | Owner: isbadawi
Type: Bug | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e501d4c505ede0c87c2d1a8667167314021489e2"]:
{{{
#!CommitTicketReference repository=""
revision="e501d4c505ede0c87c2d1a8667167314021489e2"
Fixed #23597 -- Clarified the manager that
{Single,Multiple}ObjectMixin.model uses.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:4>

Django

unread,
Oct 6, 2014, 8:24:24 AM10/6/14
to django-...@googlegroups.com
#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+------------------------------------
Reporter: isbadawi | Owner: isbadawi
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"0aad1f1ea912e1c855c1ff9c0b89fa28d2035ca3"]:
{{{
#!CommitTicketReference repository=""
revision="0aad1f1ea912e1c855c1ff9c0b89fa28d2035ca3"
[1.6.x] Fixed #23597 -- Clarified the manager that
{Single,Multiple}ObjectMixin.model uses.

Backport of e501d4c505 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:5>

Django

unread,
Oct 6, 2014, 8:24:27 AM10/6/14
to django-...@googlegroups.com
#23597: docs: specifying SingleObjectMixin.model uses default manager, not
necessarily objects
-------------------------------+------------------------------------
Reporter: isbadawi | Owner: isbadawi
Type: Bug | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"e9609fb7a1758e5de10360d4f181a6e602658406"]:
{{{
#!CommitTicketReference repository=""
revision="e9609fb7a1758e5de10360d4f181a6e602658406"
[1.7.x] Fixed #23597 -- Clarified the manager that
{Single,Multiple}ObjectMixin.model uses.

Backport of e501d4c505 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23597#comment:6>

Reply all
Reply to author
Forward
0 new messages