Merge pull request #261 from issackelly/cbv-full-list
Create headings and expand CBV docs so that the "Built-In CBV" docs include a full list.
This commit is contained in:
commit
4eaf73d7bc
|
@ -8,6 +8,9 @@ themselves or inherited from. They may not provide all the capabilities
|
||||||
required for projects, in which case there are Mixins and Generic class-based
|
required for projects, in which case there are Mixins and Generic class-based
|
||||||
views.
|
views.
|
||||||
|
|
||||||
|
View
|
||||||
|
----
|
||||||
|
|
||||||
.. class:: django.views.generic.base.View
|
.. class:: django.views.generic.base.View
|
||||||
|
|
||||||
The master class-based base view. All other class-based views inherit from
|
The master class-based base view. All other class-based views inherit from
|
||||||
|
@ -68,6 +71,9 @@ views.
|
||||||
methods defined directly on the class are documented here, not methods
|
methods defined directly on the class are documented here, not methods
|
||||||
defined on superclasses.
|
defined on superclasses.
|
||||||
|
|
||||||
|
TemplateView
|
||||||
|
------------
|
||||||
|
|
||||||
.. class:: django.views.generic.base.TemplateView
|
.. class:: django.views.generic.base.TemplateView
|
||||||
|
|
||||||
Renders a given template, passing it a ``{{ params }}`` template variable,
|
Renders a given template, passing it a ``{{ params }}`` template variable,
|
||||||
|
@ -132,6 +138,9 @@ views.
|
||||||
methods defined directly on the class are documented here, not methods
|
methods defined directly on the class are documented here, not methods
|
||||||
defined on superclasses.
|
defined on superclasses.
|
||||||
|
|
||||||
|
RedirectView
|
||||||
|
------------
|
||||||
|
|
||||||
.. class:: django.views.generic.base.RedirectView
|
.. class:: django.views.generic.base.RedirectView
|
||||||
|
|
||||||
Redirects to a given URL.
|
Redirects to a given URL.
|
||||||
|
|
|
@ -5,6 +5,9 @@ Generic date views
|
||||||
Date-based generic views (in the module :mod:`django.views.generic.dates`)
|
Date-based generic views (in the module :mod:`django.views.generic.dates`)
|
||||||
are views for displaying drilldown pages for date-based data.
|
are views for displaying drilldown pages for date-based data.
|
||||||
|
|
||||||
|
ArchiveIndexView
|
||||||
|
----------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.ArchiveIndexView
|
.. class:: django.views.generic.dates.ArchiveIndexView
|
||||||
|
|
||||||
A top-level index page showing the "latest" objects, by date. Objects with
|
A top-level index page showing the "latest" objects, by date. Objects with
|
||||||
|
@ -27,6 +30,9 @@ are views for displaying drilldown pages for date-based data.
|
||||||
* Uses a default ``context_object_name`` of ``latest``.
|
* Uses a default ``context_object_name`` of ``latest``.
|
||||||
* Uses a default ``template_name_suffix`` of ``_archive``.
|
* Uses a default ``template_name_suffix`` of ``_archive``.
|
||||||
|
|
||||||
|
YearArchiveView
|
||||||
|
---------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.YearArchiveView
|
.. class:: django.views.generic.dates.YearArchiveView
|
||||||
|
|
||||||
A yearly archive page showing all available months in a given year. Objects
|
A yearly archive page showing all available months in a given year. Objects
|
||||||
|
@ -86,6 +92,9 @@ are views for displaying drilldown pages for date-based data.
|
||||||
|
|
||||||
* Uses a default ``template_name_suffix`` of ``_archive_year``.
|
* Uses a default ``template_name_suffix`` of ``_archive_year``.
|
||||||
|
|
||||||
|
MonthArchiveView
|
||||||
|
----------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.MonthArchiveView
|
.. class:: django.views.generic.dates.MonthArchiveView
|
||||||
|
|
||||||
A monthly archive page showing all objects in a given month. Objects with a
|
A monthly archive page showing all objects in a given month. Objects with a
|
||||||
|
@ -134,6 +143,9 @@ are views for displaying drilldown pages for date-based data.
|
||||||
|
|
||||||
* Uses a default ``template_name_suffix`` of ``_archive_month``.
|
* Uses a default ``template_name_suffix`` of ``_archive_month``.
|
||||||
|
|
||||||
|
WeekArchiveView
|
||||||
|
---------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.WeekArchiveView
|
.. class:: django.views.generic.dates.WeekArchiveView
|
||||||
|
|
||||||
A weekly archive page showing all objects in a given week. Objects with a
|
A weekly archive page showing all objects in a given week. Objects with a
|
||||||
|
@ -175,6 +187,9 @@ are views for displaying drilldown pages for date-based data.
|
||||||
|
|
||||||
* Uses a default ``template_name_suffix`` of ``_archive_week``.
|
* Uses a default ``template_name_suffix`` of ``_archive_week``.
|
||||||
|
|
||||||
|
DayArchiveView
|
||||||
|
--------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.DayArchiveView
|
.. class:: django.views.generic.dates.DayArchiveView
|
||||||
|
|
||||||
A day archive page showing all objects in a given day. Days in the future
|
A day archive page showing all objects in a given day. Days in the future
|
||||||
|
@ -225,6 +240,9 @@ are views for displaying drilldown pages for date-based data.
|
||||||
|
|
||||||
* Uses a default ``template_name_suffix`` of ``_archive_day``.
|
* Uses a default ``template_name_suffix`` of ``_archive_day``.
|
||||||
|
|
||||||
|
TodayArchiveView
|
||||||
|
----------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.TodayArchiveView
|
.. class:: django.views.generic.dates.TodayArchiveView
|
||||||
|
|
||||||
A day archive page showing all objects for *today*. This is exactly the
|
A day archive page showing all objects for *today*. This is exactly the
|
||||||
|
@ -246,6 +264,10 @@ are views for displaying drilldown pages for date-based data.
|
||||||
* :class:`django.views.generic.dates.DateMixin`
|
* :class:`django.views.generic.dates.DateMixin`
|
||||||
* :class:`django.views.generic.base.View`
|
* :class:`django.views.generic.base.View`
|
||||||
|
|
||||||
|
|
||||||
|
DateDetailView
|
||||||
|
--------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.DateDetailView
|
.. class:: django.views.generic.dates.DateDetailView
|
||||||
|
|
||||||
A page representing an individual object. If the object has a date value in
|
A page representing an individual object. If the object has a date value in
|
||||||
|
|
|
@ -5,6 +5,9 @@ Generic display views
|
||||||
The two following generic class-based views are designed to display data. On
|
The two following generic class-based views are designed to display data. On
|
||||||
many projects they are typically the most commonly used views.
|
many projects they are typically the most commonly used views.
|
||||||
|
|
||||||
|
DetailView
|
||||||
|
----------
|
||||||
|
|
||||||
.. class:: django.views.generic.detail.DetailView
|
.. class:: django.views.generic.detail.DetailView
|
||||||
|
|
||||||
While this view is executing, ``self.object`` will contain the object that
|
While this view is executing, ``self.object`` will contain the object that
|
||||||
|
@ -57,6 +60,9 @@ many projects they are typically the most commonly used views.
|
||||||
url(r'^(?P<slug>[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'),
|
url(r'^(?P<slug>[-_\w]+)/$', ArticleDetailView.as_view(), name='article-detail'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ListView
|
||||||
|
--------
|
||||||
|
|
||||||
.. class:: django.views.generic.list.ListView
|
.. class:: django.views.generic.list.ListView
|
||||||
|
|
||||||
A page representing a list of objects.
|
A page representing a list of objects.
|
||||||
|
|
|
@ -25,6 +25,9 @@ editing content:
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('author-detail', kwargs={'pk': self.pk})
|
return reverse('author-detail', kwargs={'pk': self.pk})
|
||||||
|
|
||||||
|
FormView
|
||||||
|
--------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.FormView
|
.. class:: django.views.generic.edit.FormView
|
||||||
|
|
||||||
A view that displays a form. On error, redisplays the form with validation
|
A view that displays a form. On error, redisplays the form with validation
|
||||||
|
@ -69,6 +72,8 @@ editing content:
|
||||||
form.send_email()
|
form.send_email()
|
||||||
return super(ContactView, self).form_valid(form)
|
return super(ContactView, self).form_valid(form)
|
||||||
|
|
||||||
|
CreateView
|
||||||
|
----------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.CreateView
|
.. class:: django.views.generic.edit.CreateView
|
||||||
|
|
||||||
|
@ -107,6 +112,9 @@ editing content:
|
||||||
class AuthorCreate(CreateView):
|
class AuthorCreate(CreateView):
|
||||||
model = Author
|
model = Author
|
||||||
|
|
||||||
|
UpdateView
|
||||||
|
----------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.UpdateView
|
.. class:: django.views.generic.edit.UpdateView
|
||||||
|
|
||||||
A view that displays a form for editing an existing object, redisplaying
|
A view that displays a form for editing an existing object, redisplaying
|
||||||
|
@ -146,6 +154,9 @@ editing content:
|
||||||
class AuthorUpdate(UpdateView):
|
class AuthorUpdate(UpdateView):
|
||||||
model = Author
|
model = Author
|
||||||
|
|
||||||
|
DeleteView
|
||||||
|
----------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.DeleteView
|
.. class:: django.views.generic.edit.DeleteView
|
||||||
|
|
||||||
A view that displays a confirmation page and deletes an existing object.
|
A view that displays a confirmation page and deletes an existing object.
|
||||||
|
|
|
@ -6,7 +6,7 @@ Class-based views API reference. For introductory material, see
|
||||||
:doc:`/topics/class-based-views/index`.
|
:doc:`/topics/class-based-views/index`.
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 3
|
||||||
|
|
||||||
base
|
base
|
||||||
generic-display
|
generic-display
|
||||||
|
|
|
@ -3,6 +3,9 @@ Date-based mixins
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
|
||||||
|
YearMixin
|
||||||
|
---------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.YearMixin
|
.. class:: django.views.generic.dates.YearMixin
|
||||||
|
|
||||||
A mixin that can be used to retrieve and provide parsing information for a
|
A mixin that can be used to retrieve and provide parsing information for a
|
||||||
|
@ -36,6 +39,9 @@ Date-based mixins
|
||||||
|
|
||||||
Raises a 404 if no valid year specification can be found.
|
Raises a 404 if no valid year specification can be found.
|
||||||
|
|
||||||
|
MonthMixin
|
||||||
|
----------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.MonthMixin
|
.. class:: django.views.generic.dates.MonthMixin
|
||||||
|
|
||||||
A mixin that can be used to retrieve and provide parsing information for a
|
A mixin that can be used to retrieve and provide parsing information for a
|
||||||
|
@ -82,6 +88,9 @@ Date-based mixins
|
||||||
date provided. If ``allow_empty = False``, returns the previous month
|
date provided. If ``allow_empty = False``, returns the previous month
|
||||||
that contained data.
|
that contained data.
|
||||||
|
|
||||||
|
DayMixin
|
||||||
|
--------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.DayMixin
|
.. class:: django.views.generic.dates.DayMixin
|
||||||
|
|
||||||
A mixin that can be used to retrieve and provide parsing information for a
|
A mixin that can be used to retrieve and provide parsing information for a
|
||||||
|
@ -127,6 +136,9 @@ Date-based mixins
|
||||||
Returns a date object containing the previous day. If
|
Returns a date object containing the previous day. If
|
||||||
``allow_empty = False``, returns the previous day that contained data.
|
``allow_empty = False``, returns the previous day that contained data.
|
||||||
|
|
||||||
|
WeekMixin
|
||||||
|
---------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.WeekMixin
|
.. class:: django.views.generic.dates.WeekMixin
|
||||||
|
|
||||||
A mixin that can be used to retrieve and provide parsing information for a
|
A mixin that can be used to retrieve and provide parsing information for a
|
||||||
|
@ -161,6 +173,9 @@ Date-based mixins
|
||||||
Raises a 404 if no valid week specification can be found.
|
Raises a 404 if no valid week specification can be found.
|
||||||
|
|
||||||
|
|
||||||
|
DateMixin
|
||||||
|
---------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.DateMixin
|
.. class:: django.views.generic.dates.DateMixin
|
||||||
|
|
||||||
A mixin class providing common behavior for all date-based views.
|
A mixin class providing common behavior for all date-based views.
|
||||||
|
@ -204,6 +219,9 @@ Date-based mixins
|
||||||
is greater than the current date/time. Returns
|
is greater than the current date/time. Returns
|
||||||
:attr:`DateMixin.allow_future` by default.
|
:attr:`DateMixin.allow_future` by default.
|
||||||
|
|
||||||
|
BaseDateListView
|
||||||
|
----------------
|
||||||
|
|
||||||
.. class:: django.views.generic.dates.BaseDateListView
|
.. class:: django.views.generic.dates.BaseDateListView
|
||||||
|
|
||||||
A base class that provides common behavior for all date-based views. There
|
A base class that provides common behavior for all date-based views. There
|
||||||
|
|
|
@ -14,6 +14,9 @@ The following mixins are used to construct Django's editing views:
|
||||||
Examples of how these are combined into editing views can be found at
|
Examples of how these are combined into editing views can be found at
|
||||||
the documentation on ``Generic editing views``.
|
the documentation on ``Generic editing views``.
|
||||||
|
|
||||||
|
FormMixin
|
||||||
|
---------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.FormMixin
|
.. class:: django.views.generic.edit.FormMixin
|
||||||
|
|
||||||
A mixin class that provides facilities for creating and displaying forms.
|
A mixin class that provides facilities for creating and displaying forms.
|
||||||
|
@ -90,6 +93,9 @@ The following mixins are used to construct Django's editing views:
|
||||||
:meth:`~django.views.generic.FormMixin.form_invalid`.
|
:meth:`~django.views.generic.FormMixin.form_invalid`.
|
||||||
|
|
||||||
|
|
||||||
|
ModelFormMixin
|
||||||
|
--------------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.ModelFormMixin
|
.. class:: django.views.generic.edit.ModelFormMixin
|
||||||
|
|
||||||
A form mixin that works on ModelForms, rather than a standalone form.
|
A form mixin that works on ModelForms, rather than a standalone form.
|
||||||
|
@ -148,6 +154,10 @@ The following mixins are used to construct Django's editing views:
|
||||||
|
|
||||||
Renders a response, providing the invalid form as context.
|
Renders a response, providing the invalid form as context.
|
||||||
|
|
||||||
|
|
||||||
|
ProcessFormView
|
||||||
|
---------------
|
||||||
|
|
||||||
.. class:: django.views.generic.edit.ProcessFormView
|
.. class:: django.views.generic.edit.ProcessFormView
|
||||||
|
|
||||||
A mixin that provides basic HTTP GET and POST workflow.
|
A mixin that provides basic HTTP GET and POST workflow.
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
Multiple object mixins
|
Multiple object mixins
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
MultipleObjectMixin
|
||||||
|
-------------------
|
||||||
|
|
||||||
.. class:: django.views.generic.list.MultipleObjectMixin
|
.. class:: django.views.generic.list.MultipleObjectMixin
|
||||||
|
|
||||||
A mixin that can be used to display a list of objects.
|
A mixin that can be used to display a list of objects.
|
||||||
|
@ -148,6 +151,9 @@ Multiple object mixins
|
||||||
this context variable will be ``None``.
|
this context variable will be ``None``.
|
||||||
|
|
||||||
|
|
||||||
|
MultipleObjectTemplateResponseMixin
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
.. class:: django.views.generic.list.MultipleObjectTemplateResponseMixin
|
.. class:: django.views.generic.list.MultipleObjectTemplateResponseMixin
|
||||||
|
|
||||||
A mixin class that performs template-based response rendering for views
|
A mixin class that performs template-based response rendering for views
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
Simple mixins
|
Simple mixins
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
ContextMixin
|
||||||
|
------------
|
||||||
|
|
||||||
.. class:: django.views.generic.base.ContextMixin
|
.. class:: django.views.generic.base.ContextMixin
|
||||||
|
|
||||||
.. versionadded:: 1.5
|
.. versionadded:: 1.5
|
||||||
|
@ -17,6 +20,9 @@ Simple mixins
|
||||||
Returns a dictionary representing the template context. The
|
Returns a dictionary representing the template context. The
|
||||||
keyword arguments provided will make up the returned context.
|
keyword arguments provided will make up the returned context.
|
||||||
|
|
||||||
|
TemplateResponseMixin
|
||||||
|
---------------------
|
||||||
|
|
||||||
.. class:: django.views.generic.base.TemplateResponseMixin
|
.. class:: django.views.generic.base.TemplateResponseMixin
|
||||||
|
|
||||||
Provides a mechanism to construct a
|
Provides a mechanism to construct a
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
Single object mixins
|
Single object mixins
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
SingleObjectMixin
|
||||||
|
-----------------
|
||||||
|
|
||||||
.. class:: django.views.generic.detail.SingleObjectMixin
|
.. class:: django.views.generic.detail.SingleObjectMixin
|
||||||
|
|
||||||
Provides a mechanism for looking up an object associated with the
|
Provides a mechanism for looking up an object associated with the
|
||||||
|
@ -86,6 +89,9 @@ Single object mixins
|
||||||
``context_object_name`` is specified, that variable will also be
|
``context_object_name`` is specified, that variable will also be
|
||||||
set in the context, with the same value as ``object``.
|
set in the context, with the same value as ``object``.
|
||||||
|
|
||||||
|
SingleObjectTemplateResponseMixin
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
.. class:: django.views.generic.detail.SingleObjectTemplateResponseMixin
|
.. class:: django.views.generic.detail.SingleObjectTemplateResponseMixin
|
||||||
|
|
||||||
A mixin class that performs template-based response rendering for views
|
A mixin class that performs template-based response rendering for views
|
||||||
|
|
Loading…
Reference in New Issue