Author: russellm Date: 2010-10-18 10:53:31 -0500 (Mon, 18 Oct 2010) New Revision: 14257
Modified: django/trunk/docs/ref/class-based-views.txt django/trunk/docs/topics/class-based-views.txt Log: Improvements to examples and markup fixes for class-based view docs. Modified: django/trunk/docs/ref/class-based-views.txt =================================================================== --- django/trunk/docs/ref/class-based-views.txt 2010-10-18 15:53:08 UTC (rev 14256) +++ django/trunk/docs/ref/class-based-views.txt 2010-10-18 15:53:31 UTC (rev 14257) @@ -313,10 +313,9 @@ .. method:: MultipleObjectMixin.paginate_queryset(queryset, page_size) - Returns a 4-tuple containing:: + Returns a 4-tuple containing (``paginator``, ``page``, + ``object_list``, ``is_paginated``). - (``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 URL argument or as a GET argument, ``object_list`` will correspond @@ -819,10 +818,9 @@ .. method:: ArchiveView.get_dated_items(): - Returns a 3-tuple containing:: + Returns a 3-tuple containing (``date_list``, ``latest``, + ``extra_context``). - (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 dictionary of context data that will be added to any context data Modified: django/trunk/docs/topics/class-based-views.txt =================================================================== --- django/trunk/docs/topics/class-based-views.txt 2010-10-18 15:53:08 UTC (rev 14256) +++ django/trunk/docs/topics/class-based-views.txt 2010-10-18 15:53:31 UTC (rev 14257) @@ -250,7 +250,7 @@ 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 @@ 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 @@ 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 @@ 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 = datetime.datetime.now() object.save() @@ -530,6 +530,6 @@ 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 :class:`~django.views.generic.detail.SingleObjectTemplateResponseMixin`. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.