Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23597 closed Bug (fixed)

docs: specifying SingleObjectMixin.model uses default manager, not necessarily objects

Reported by: Ismail Badawi Owned by: Ismail Badawi
Component: Documentation Version: 1.7
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

This is a tiny thing I came across. The docs for SingleObjectMixin.model and 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 (here and 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.

Change History (6)

comment:1 by Tim Graham, 10 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

comment:2 by Ismail Badawi, 10 years ago

Owner: changed from nobody to Ismail Badawi
Status: newassigned

comment:3 by Ismail Badawi, 10 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In e501d4c505ede0c87c2d1a8667167314021489e2:

Fixed #23597 -- Clarified the manager that {Single,Multiple}ObjectMixin.model uses.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In 0aad1f1ea912e1c855c1ff9c0b89fa28d2035ca3:

[1.6.x] Fixed #23597 -- Clarified the manager that {Single,Multiple}ObjectMixin.model uses.

Backport of e501d4c505 from master

comment:6 by Tim Graham <timograham@…>, 10 years ago

In e9609fb7a1758e5de10360d4f181a6e602658406:

[1.7.x] Fixed #23597 -- Clarified the manager that {Single,Multiple}ObjectMixin.model uses.

Backport of e501d4c505 from master

Note: See TracTickets for help on using tickets.
Back to Top