Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #6890 -- Removed duplicate instruction to rename the `polls/det…

…ail.htm` template in tutorial part 4.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7380 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a3747f23be69d607fdaa4fbc757341c4673ecd1f 1 parent 165772f
Gary Wilson Jr. authored March 29, 2008

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

  1. 13  docs/tutorial04.txt
13  docs/tutorial04.txt
@@ -37,7 +37,7 @@ A quick rundown:
37 37
       form will alter data server-side. Whenever you create a form that alters
38 38
       data server-side, use ``method="post"``. This tip isn't specific to
39 39
       Django; it's just good Web development practice.
40  
-    
  40
+
41 41
     * ``forloop.counter`` indicates how many times the ``for`` tag has
42 42
       gone through its loop. For more information, see `the
43 43
       documentation for the "for" tag`_.
@@ -247,8 +247,8 @@ template. Note that we use ``dict()`` to return an altered dictionary in place.
247 247
     which is "lazy" and doesn't hit your database until it absolutely has to. By
248 248
     the time the database query happens, the ``object_detail`` generic view will
249 249
     have narrowed its scope down to a single object, so the eventual query will
250  
-    only select one row from the database. 
251  
-    
  250
+    only select one row from the database.
  251
+
252 252
     If you'd like to know more about how that works, The Django database API
253 253
     documentation `explains the lazy nature of QuerySet objects`_.
254 254
 
@@ -266,9 +266,8 @@ from ``polls/views.py``. We don't need them anymore -- they have been replaced
266 266
 by generic views.
267 267
 
268 268
 The ``vote()`` view is still required. However, it must be modified to match
269  
-the new templates and context variables. Change the template call from
270  
-``polls/detail.html`` to ``polls/poll_detail.html``, and pass ``object`` in the
271  
-context instead of ``poll``.
  269
+the new context variables. In the ``render_to_repsonse()`` call, rename the
  270
+``poll`` context variable to ``object``.
272 271
 
273 272
 The last thing to do is fix the URL handling to account for the use of generic
274 273
 views. In the vote view above, we used the ``reverse()`` function to avoid
@@ -276,7 +275,7 @@ hard-coding our URLs. Now that we've switched to a generic view, we'll need to
276 275
 change the ``reverse()`` call to point back to our new generic view. We can't
277 276
 simply use the view function anymore -- generic views can be (and are) used
278 277
 multiple times -- but we can use the name we've given::
279  
-    
  278
+
280 279
     return HttpResponseRedirect(reverse('poll_results', args=(p.id,)))
281 280
 
282 281
 Run the server, and use your new polling app based on generic views.

0 notes on commit a3747f2

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