Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #11554: Several errors in Generic Views Documentation.

Thanks Ramiro. 
Refs #11477 - that ticket should have been marked a duplicate of #11554



git-svn-id: http://code.djangoproject.com/svn/django/trunk@11499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8da58e51ff117ffe209cefbd3a5f008dd163bec4 1 parent 7c53c26
Luke Plant authored September 11, 2009

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  docs/topics/generic-views.txt
16  docs/topics/generic-views.txt
@@ -150,7 +150,7 @@ be using these models::
150 150
         publisher = models.ForeignKey(Publisher)
151 151
         publication_date = models.DateField()
152 152
 
153  
-To build a list page of all books, we'd use a URLconf along these lines::
  153
+To build a list page of all publishers, we'd use a URLconf along these lines::
154 154
 
155 155
     from django.conf.urls.defaults import *
156 156
     from django.views.generic import list_detail
@@ -176,7 +176,7 @@ version of the model's name.
176 176
 .. highlightlang:: html+django
177 177
 
178 178
 This template will be rendered against a context containing a variable called
179  
-``object_list`` that contains all the book objects. A very simple template
  179
+``object_list`` that contains all the publisher objects. A very simple template
180 180
 might look like the following::
181 181
 
182 182
     {% extends "base.html" %}
@@ -217,7 +217,7 @@ Making "friendly" template contexts
217 217
 You might have noticed that our sample publisher list template stores all the
218 218
 books in a variable named ``object_list``. While this works just fine, it isn't
219 219
 all that "friendly" to template authors: they have to "just know" that they're
220  
-dealing with books here. A better name for that variable would be
  220
+dealing with publishers here. A better name for that variable would be
221 221
 ``publisher_list``; that variable's content is pretty obvious.
222 222
 
223 223
 We can change the name of that variable easily with the ``template_object_name``
@@ -241,14 +241,14 @@ Adding extra context
241 241
 --------------------
242 242
 
243 243
 Often you simply need to present some extra information beyond that provided by
244  
-the generic view. For example, think of showing a list of all the other
245  
-publishers on each publisher detail page. The ``object_detail`` generic view
246  
-provides the publisher to the context, but it seems there's no way to get a list
247  
-of *all* publishers in that template.
  244
+the generic view. For example, think of showing a list of all the books on each
  245
+publisher detail page. The ``object_detail`` generic view provides the
  246
+publisher to the context, but it seems there's no way to get additional
  247
+information in that template.
248 248
 
249 249
 But there is: all generic views take an extra optional parameter,
250 250
 ``extra_context``. This is a dictionary of extra objects that will be added to
251  
-the template's context. So, to provide the list of all publishers on the detail
  251
+the template's context. So, to provide the list of all books on the detail
252 252
 detail view, we'd use an info dict like this:
253 253
 
254 254
 .. parsed-literal::

0 notes on commit 8da58e5

Please sign in to comment.
Something went wrong with that request. Please try again.