diff --git a/docs/tutorial03.txt b/docs/tutorial03.txt
index d49a417..8f8576e 100644
a
|
b
|
first argument to ``patterns()``, like so::
|
402 | 402 | urlpatterns = patterns('mysite.polls.views', |
403 | 403 | (r'^polls/$', 'index'), |
404 | 404 | (r'^polls/(?P<poll_id>\d+)/$', 'detail'), |
405 | | (r'^polls/(?P<poll_id>\d+)/results/$', 'results'), |
406 | | (r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'), |
| 405 | #(r'^polls/(?P<poll_id>\d+)/results/$', 'results'), |
| 406 | #(r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'), |
407 | 407 | ) |
408 | 408 | |
409 | 409 | This is functionally identical to the previous formatting. It's just a bit |
410 | 410 | tidier. |
411 | 411 | |
| 412 | Note that we commented out the ``results`` and ``vote`` patterns as, at this stage, |
| 413 | we still have not written those views and Django would give us errors trying to find |
| 414 | them. |
| 415 | |
412 | 416 | Decoupling the URLconfs |
413 | 417 | ======================= |
414 | 418 | |
… |
… |
line::
|
451 | 455 | urlpatterns = patterns('mysite.polls.views', |
452 | 456 | (r'^$', 'index'), |
453 | 457 | (r'^(?P<poll_id>\d+)/$', 'detail'), |
454 | | (r'^(?P<poll_id>\d+)/results/$', 'results'), |
455 | | (r'^(?P<poll_id>\d+)/vote/$', 'vote'), |
| 458 | #(r'^(?P<poll_id>\d+)/results/$', 'results'), |
| 459 | #(r'^(?P<poll_id>\d+)/vote/$', 'vote'), |
456 | 460 | ) |
457 | 461 | |
458 | 462 | The idea behind ``include()`` and URLconf decoupling is to make it easy to |
diff --git a/docs/tutorial04.txt b/docs/tutorial04.txt
index bd16fa2..9f2a092 100644
a
|
b
|
So let's create a ``vote()`` function in ``mysite/polls/views.py``::
|
69 | 69 | # user hits the Back button. |
70 | 70 | return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(p.id,))) |
71 | 71 | |
| 72 | Remember to uncomment the ``urlpattern`` for ``vote`` that we commented on part |
| 73 | 3 of this tutorial. |
| 74 | |
72 | 75 | This code includes a few things we haven't covered yet in this tutorial: |
73 | 76 | |
74 | 77 | * ``request.POST`` is a dictionary-like object that lets you access |
… |
… |
page for the poll. Let's write that view::
|
120 | 123 | p = get_object_or_404(Poll, pk=poll_id) |
121 | 124 | return render_to_response('polls/results.html', {'poll': p}) |
122 | 125 | |
| 126 | Again, remember to uncomment the ``urlpattern`` for ``results`` that we commented |
| 127 | on part 3 of this tutorial. |
| 128 | |
123 | 129 | This is almost exactly the same as the ``detail()`` view from `Tutorial 3`_. |
124 | 130 | The only difference is the template name. We'll fix this redundancy later. |
125 | 131 | |