Django

Code

Show
Ignore:
Timestamp:
03/29/08 10:48:13 (7 months ago)
Author:
gwilson
Message:

Fixed #6890 -- Removed duplicate instruction to rename the polls/detail.htm template in tutorial part 4.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/tutorial04.txt

    r7361 r7380  
    3838      data server-side, use ``method="post"``. This tip isn't specific to 
    3939      Django; it's just good Web development practice. 
    40      
     40 
    4141    * ``forloop.counter`` indicates how many times the ``for`` tag has 
    4242      gone through its loop. For more information, see `the 
     
    248248    the time the database query happens, the ``object_detail`` generic view will 
    249249    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 
    252252    If you'd like to know more about how that works, The Django database API 
    253253    documentation `explains the lazy nature of QuerySet objects`_. 
     
    267267 
    268268The ``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``. 
     269the new context variables. In the ``render_to_repsonse()`` call, rename the 
     270``poll`` context variable to ``object``. 
    272271 
    273272The last thing to do is fix the URL handling to account for the use of generic 
     
    277276simply use the view function anymore -- generic views can be (and are) used 
    278277multiple times -- but we can use the name we've given:: 
    279      
     278 
    280279    return HttpResponseRedirect(reverse('poll_results', args=(p.id,))) 
    281280