Changeset 5401
- Timestamp:
- 06/01/07 04:35:29 (1 year ago)
- Files:
-
- django/trunk/docs/tutorial04.txt (modified) (2 diffs)
- django/trunk/docs/url_dispatch.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/tutorial04.txt
r5368 r5401 68 68 # with POST data. This prevents data from being posted twice if a 69 69 # user hits the Back button. 70 return HttpResponseRedirect(reverse(' results', args=(p.id,)))70 return HttpResponseRedirect(reverse('mysite.polls.views.results', args=(p.id,))) 71 71 72 72 This code includes a few things we haven't covered yet in this tutorial: … … 105 105 106 106 ... where the ``3`` is the value of ``p.id``. This redirected URL will 107 then call the ``'results'`` view to display the final page. 107 then call the ``'results'`` view to display the final page. Note that 108 you need to use the full name of the view here (including the prefix). 108 109 109 110 For more information about ``reverse()``, see the `URL dispatcher`_ django/trunk/docs/url_dispatch.txt
r5369 r5401 565 565 reverse(viewname, urlconf=None, args=None, kwargs=None) 566 566 567 The view name is either the function name or the `URL pattern name`_. 568 Normally you will not need to worry about the ``urlconf`` parameter and will 569 only pass in the positional and keyword arguments to use in the url matching. 570 For example:: 567 The view name is either the function name (either a function reference, or the 568 string version of the name, if you used that form in ``urlpatterns``) or the 569 `URL pattern name`_. Normally you will not need to worry about the 570 ``urlconf`` parameter and will only pass in the positional and keyword 571 arguments to use in the url matching. For example:: 571 572 572 573 from django.core.urlresolvers import reverse
