Opened 5 years ago

Closed 5 years ago

#16464 closed Bug (fixed)

Ref for DateDetailView lists wrong mixins

Reported by: michal@… Owned by: teraom
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://code.djangoproject.com/browser/django/trunk/docs/ref/class-based-views.txt?rev=16381#L1303

Lists:

  • :class:django.views.generic.list.MultipleObjectTemplateResponseMixin
  • :class:django.views.generic.dates.BaseDateListView

As mixins for the DateDetailView, when according to:
https://code.djangoproject.com/browser/django/trunk/django/views/generic/dates.py?rev=16363#L481

the correct entries should be:

  • :class:django.views.generic.list.SingleObjectTemplateResponseMixin
  • :class:django.views.generic.dates.BaseDateDetailView

Attachments (2)

DateDetailView-mixins-16464.diff (988 bytes) - added by teraom 5 years ago.
16464.class-based-views-doc-fixes.diff (1.6 KB) - added by Julien Phalip 5 years ago.
Doc fixes to reflect my previous comments

Download all attachments as: .zip

Change History (9)

comment:1 Changed 5 years ago by Julien Phalip

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Accepted. Note that SingleObjectTemplateResponseMixin is in the django.views.generic.detail package. Also, BaseDateListView should be replaced by django.views.generic.detail.BaseDetailView, not django.views.generic.dates.BaseDateDetailView. DateMixin is also missing from the list of mixins for DateDetailView.

On a related matter, a bit further up the docs stipulate that TodayArchiveView inherits from DayArchiveView whereas in fact it just happens to inherit from the same mixins as DayArchiveView, i.e. MultipleObjectTemplateResponseMixin and BaseDayArchiveView. I'm saying this just to point out that it might be worth scanning for other similar inconsistencies or inaccuracies in the rest of that doc page.

comment:2 Changed 5 years ago by teraom

Owner: changed from nobody to teraom
Status: newassigned

comment:3 Changed 5 years ago by teraom

Has patch: set

comment:4 Changed 5 years ago by Julien Phalip

Patch needs improvement: set

This is great, thank you. Just one little thing: if we follow the convention in other documented views on that page, then BaseDayArchiveView (instead of BaseTodayArchiveView) should be mentioned as a mixin of TodayArchiveView.

Also, now that I'm looking at it again, the doc for TodayArchiveView says: "This is exactly the same as archive_day". archive_day has now been deprecated so it shouldn't be mentioned any more. I guess DayArchiveView should be mentioned instead.

Changed 5 years ago by teraom

comment:5 Changed 5 years ago by teraom

Patch needs improvement: unset

Removed BaseTodayArchiveView. Mixin DayArchiveView was lready listed.

Version 0, edited 5 years ago by teraom (next)

Changed 5 years ago by Julien Phalip

Doc fixes to reflect my previous comments

comment:6 Changed 5 years ago by Aymeric Augustin

Triage Stage: AcceptedReady for checkin

Good to go.

comment:7 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

In [16563]:

Fixed #16464 -- Fixed the reference docs of the DateDetailView view. Thanks, Julien Phalip.

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