Commit 4eaf73d7 authored by Tim Graham's avatar Tim Graham
Browse files

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.
parents ad11dbf6 060ac8e7
Loading
Loading
Loading
Loading
+22 −13
Original line number Diff line number Diff line
@@ -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
views.

View
----

.. class:: django.views.generic.base.View

    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
        defined on superclasses.

TemplateView
------------

.. class:: django.views.generic.base.TemplateView

    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
        defined on superclasses.

RedirectView
------------

.. class:: django.views.generic.base.RedirectView

    Redirects to a given URL.
+23 −1
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Generic date views
Date-based generic views (in the module :mod:`django.views.generic.dates`)
are views for displaying drilldown pages for date-based data.

ArchiveIndexView
----------------

.. class:: django.views.generic.dates.ArchiveIndexView

    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 ``template_name_suffix`` of ``_archive``.

YearArchiveView
---------------

.. class:: django.views.generic.dates.YearArchiveView

    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``.

MonthArchiveView
----------------

.. class:: django.views.generic.dates.MonthArchiveView

    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``.

WeekArchiveView
---------------

.. class:: django.views.generic.dates.WeekArchiveView

    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``.

DayArchiveView
--------------

.. class:: django.views.generic.dates.DayArchiveView

    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``.

TodayArchiveView
----------------

.. class:: django.views.generic.dates.TodayArchiveView

    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.base.View`


DateDetailView
--------------

.. class:: django.views.generic.dates.DateDetailView

    A page representing an individual object. If the object has a date value in
+8 −2
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Generic display views
The two following generic class-based views are designed to display data. On
many projects they are typically the most commonly used views.

DetailView
----------

.. class:: django.views.generic.detail.DetailView

    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'),
        )

ListView
--------

.. class:: django.views.generic.list.ListView

    A page representing a list of objects.
+19 −8
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ editing content:
            def get_absolute_url(self):
                return reverse('author-detail', kwargs={'pk': self.pk})

FormView
--------

.. class:: django.views.generic.edit.FormView

    A view that displays a form. On error, redisplays the form with validation
@@ -69,6 +72,8 @@ editing content:
                form.send_email()
                return super(ContactView, self).form_valid(form)

CreateView
----------

.. class:: django.views.generic.edit.CreateView

@@ -107,6 +112,9 @@ editing content:
        class AuthorCreate(CreateView):
            model = Author

UpdateView
----------

.. class:: django.views.generic.edit.UpdateView

    A view that displays a form for editing an existing object, redisplaying
@@ -146,6 +154,9 @@ editing content:
        class AuthorUpdate(UpdateView):
            model = Author

DeleteView
----------

.. class:: django.views.generic.edit.DeleteView

    A view that displays a confirmation page and deletes an existing object.
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Class-based views API reference. For introductory material, see
:doc:`/topics/class-based-views/index`.

.. toctree::
   :maxdepth: 1
   :maxdepth: 3

   base
   generic-display
Loading