From 20e0e47f252ad97568efefe25e2442b42fd96713 Mon Sep 17 00:00:00 2001 From: Anil Khatri Date: Wed, 3 Feb 2021 19:55:56 +0530 Subject: [PATCH] [3.2.x] Fixed #32408 -- Doc'd django.views.generic.detail.BaseDetailView. Backport of de4492fbb1e48f8b258baa182220d4247f345177 from master --- .../class-based-views/generic-date-based.txt | 2 +- .../ref/class-based-views/generic-display.txt | 22 ++++++++++++++++++- .../ref/class-based-views/generic-editing.txt | 2 +- docs/topics/class-based-views/mixins.txt | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/ref/class-based-views/generic-date-based.txt b/docs/ref/class-based-views/generic-date-based.txt index dcfb16e54b..ff68edb1cf 100644 --- a/docs/ref/class-based-views/generic-date-based.txt +++ b/docs/ref/class-based-views/generic-date-based.txt @@ -582,7 +582,7 @@ views for displaying drilldown pages for date-based data. * :class:`django.views.generic.dates.MonthMixin` * :class:`django.views.generic.dates.DayMixin` * :class:`django.views.generic.dates.DateMixin` - * ``django.views.generic.detail.BaseDetailView`` + * :class:`django.views.generic.detail.BaseDetailView` * :class:`django.views.generic.detail.SingleObjectMixin` * :class:`django.views.generic.base.View` diff --git a/docs/ref/class-based-views/generic-display.txt b/docs/ref/class-based-views/generic-display.txt index ac1e4c39ca..9126c6c50a 100644 --- a/docs/ref/class-based-views/generic-display.txt +++ b/docs/ref/class-based-views/generic-display.txt @@ -19,7 +19,7 @@ many projects they are typically the most commonly used views. * :class:`django.views.generic.detail.SingleObjectTemplateResponseMixin` * :class:`django.views.generic.base.TemplateResponseMixin` - * ``django.views.generic.detail.BaseDetailView`` + * :class:`django.views.generic.detail.BaseDetailView` * :class:`django.views.generic.detail.SingleObjectMixin` * :class:`django.views.generic.base.View` @@ -73,6 +73,26 @@ many projects they are typically the most commonly used views.

Published: {{ object.pub_date|date }}

Date: {{ now|date }}

+.. class:: django.views.generic.detail.BaseDetailView + + A base view for displaying a single object. It is not intended to be used + directly, but rather as a parent class of the + :class:`django.views.generic.detail.DetailView` or other views representing + details of a single object. + + **Ancestors (MRO)** + + This view inherits methods and attributes from the following views: + + * :class:`django.views.generic.detail.SingleObjectMixin` + * :class:`django.views.generic.base.View` + + **Methods** + + .. method:: get(request, *args, **kwargs) + + Adds ``object`` to the context. + ``ListView`` ============ diff --git a/docs/ref/class-based-views/generic-editing.txt b/docs/ref/class-based-views/generic-editing.txt index 0d5aebc983..195be9f806 100644 --- a/docs/ref/class-based-views/generic-editing.txt +++ b/docs/ref/class-based-views/generic-editing.txt @@ -216,7 +216,7 @@ editing content: * :class:`django.views.generic.base.TemplateResponseMixin` * ``django.views.generic.edit.BaseDeleteView`` * :class:`django.views.generic.edit.DeletionMixin` - * ``django.views.generic.detail.BaseDetailView`` + * :class:`django.views.generic.detail.BaseDetailView` * :class:`django.views.generic.detail.SingleObjectMixin` * :class:`django.views.generic.base.View` diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt index 02594b952a..c877507714 100644 --- a/docs/topics/class-based-views/mixins.txt +++ b/docs/topics/class-based-views/mixins.txt @@ -636,7 +636,7 @@ To use it, we need to mix it into a ``TemplateView`` for example, and override Equally we could use our mixin with one of the generic views. We can make our own version of :class:`~django.views.generic.detail.DetailView` by mixing ``JSONResponseMixin`` with the -``django.views.generic.detail.BaseDetailView`` -- (the +:class:`~django.views.generic.detail.BaseDetailView` -- (the :class:`~django.views.generic.detail.DetailView` before template rendering behavior has been mixed in)::