Browse files

Improvements to examples and markup fixes for class-based view docs.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2a9551a commit 4cd18ee32d39c5e9896e528f5ef87a9c92a694c2 @freakboy3742 freakboy3742 committed Oct 18, 2010
Showing with 9 additions and 11 deletions.
  1. +4 −6 docs/ref/class-based-views.txt
  2. +5 −5 docs/topics/class-based-views.txt
@@ -313,9 +313,8 @@ Note that ``page`` *must* be either a valid page number or the value
.. method:: MultipleObjectMixin.paginate_queryset(queryset, page_size)
- Returns a 4-tuple containing::
- (``paginator``, ``page``, ``object_list``, ``is_paginated``)
+ Returns a 4-tuple containing (``paginator``, ``page``,
+ ``object_list``, ``is_paginated``).
constructed by paginating ``queryset`` into pages of size ``page_size``.
If the request contains a ``page`` argument, either as a captured
@@ -819,9 +818,8 @@ for which data is available.
.. method:: ArchiveView.get_dated_items():
- Returns a 3-tuple containing::
- (date_list, latest, extra_context)
+ Returns a 3-tuple containing (``date_list``, ``latest``,
+ ``extra_context``).
``date_list`` is the list of dates for which data is available.
``object_list`` is the list of objects ``extra_context`` is a
@@ -250,7 +250,7 @@ more::
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
- context = DetailView.get_context_data(self, **kwargs)
+ context = super(DetailView, self).get_context_data(**kwargs)
# Add in a QuerySet of all the books
context['book_list'] = Book.objects.all()
return context
@@ -275,7 +275,7 @@ specify the list of objects using the ``queryset`` argument::
context_object_name = "publisher"
queryset = Publisher.object.all()
-Specifying ``mode = Publisher`` is really just shorthand for saying
+Specifying ``model = Publisher`` is really just shorthand for saying
``queryset = Publisher.objects.all()``. However, by using ``queryset``
to define a filtered list of objects you can be more specific about the
objects that will be visible in the view (see :doc:`/topics/db/queries`
@@ -387,7 +387,7 @@ use it in the template::
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
- context = ListView.get_context_data(self, **kwargs)
+ context = super(ListView, self).get_context_data(**kwargs)
# Add in the publisher
context['publisher'] = self.publisher
return context
@@ -441,7 +441,7 @@ object, so we simply override it and wrap the call::
def get_object(self, **kwargs):
# Call the superclass
- object = DetailView.get_object(self, **kwargs)
+ object = super(DetailView, self).get_object(**kwargs)
# Record the lass accessed date
object.last_accessed =
@@ -530,6 +530,6 @@ requested::
return SingleObjectTemplateResponseMixin.render_to_response(self, context)
Because of the way that Python resolves method overloading, the local
-:func:``render_to_response()`` implementation will override the
+:func:`render_to_response()` implementation will override the
versions provided by :class:`JSONResponseMixin` and

0 comments on commit 4cd18ee

Please sign in to comment.