Author: mtredinnick
Date: 2007-06-01 04:35:29 -0500 (Fri, 01 Jun 2007)
New Revision: 5401

Modified:
   django/trunk/docs/tutorial04.txt
   django/trunk/docs/url_dispatch.txt
Log:
Fixed #4409 -- Fixed a typo in tutorial (thanks, [EMAIL PROTECTED]
). Also updated the reverse() documentation to reflect that it can take
function references or strings for function names.


Modified: django/trunk/docs/tutorial04.txt
===================================================================
--- django/trunk/docs/tutorial04.txt    2007-06-01 07:30:40 UTC (rev 5400)
+++ django/trunk/docs/tutorial04.txt    2007-06-01 09:35:29 UTC (rev 5401)
@@ -67,7 +67,7 @@
             # Always return an HttpResponseRedirect after successfully dealing
             # with POST data. This prevents data from being posted twice if a
             # user hits the Back button.
-            return HttpResponseRedirect(reverse('results', args=(p.id,)))
+            return HttpResponseRedirect(reverse('mysite.polls.views.results', 
args=(p.id,)))
 
 This code includes a few things we haven't covered yet in this tutorial:
 
@@ -104,7 +104,8 @@
         '/polls/3/results/'
 
       ... where the ``3`` is the value of ``p.id``. This redirected URL will
-      then call the ``'results'`` view to display the final page.
+      then call the ``'results'`` view to display the final page. Note that
+      you need to use the full name of the view here (including the prefix).
 
       For more information about ``reverse()``, see the `URL dispatcher`_
       documentation.

Modified: django/trunk/docs/url_dispatch.txt
===================================================================
--- django/trunk/docs/url_dispatch.txt  2007-06-01 07:30:40 UTC (rev 5400)
+++ django/trunk/docs/url_dispatch.txt  2007-06-01 09:35:29 UTC (rev 5401)
@@ -564,10 +564,11 @@
 
     reverse(viewname, urlconf=None, args=None, kwargs=None)
 
-The view name is either the function name or the `URL pattern name`_.
-Normally you will not need to worry about the ``urlconf`` parameter and will
-only pass in the positional and keyword arguments to use in the url matching.
-For example::
+The view name is either the function name (either a function reference, or the
+string version of the name, if you used that form in ``urlpatterns``) or the
+`URL pattern name`_.  Normally you will not need to worry about the
+``urlconf`` parameter and will only pass in the positional and keyword
+arguments to use in the url matching.  For example::
 
     from django.core.urlresolvers import reverse
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to