Changeset 7380 for django/trunk/docs/tutorial04.txt
- Timestamp:
- 03/29/08 10:48:13 (7 months ago)
- Files:
-
- django/trunk/docs/tutorial04.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial04.txt
r7361 r7380 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 … … 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`_. … … 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 … … 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
