Fixed #22220, improved reverse() documention #2544

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

bendavis78 commented Apr 14, 2014

No description provided.

docs/ref/urlresolvers.txt
from django.core.urlresolvers import reverse
def myview(request):
return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
+You can also pass ``kargs`` instead of ``args``. For example::
Contributor

bendavis78 commented Apr 15, 2014

Ah, nice catch. Fixed.

Member

ubernostrum commented Apr 15, 2014

Could you rebase this into a single commit for sake of cleaner history when it merges?

docs/ref/urlresolvers.txt
-:ref:`URL pattern name <naming-url-patterns>`. Normally, you won't 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::
+``viewname`` can be a string containing the python path to the view object, a
@timgraham

timgraham Apr 15, 2014

Owner

python -> Python (or PYTHONPATH)?

docs/ref/urlresolvers.txt
+
+ url(r'^archive/$', 'news.views.archive', name='news_archive')
+
+you can use any of the following to resolve the url::
@timgraham

timgraham Apr 15, 2014

Owner

url -> URL

Contributor

bendavis78 commented Apr 16, 2014

Changed "python path" -> "Python path" and "url -> URL". Rebased into single commit.

-worry about the ``urlconf`` parameter and will only pass in the positional and
-keyword arguments to use in the URL matching. For example::
+``viewname`` can be a string containing the Python path to the view object, a
+`URL pattern name`_, or the callable view object. For example, given the
@timgraham

timgraham Apr 16, 2014

Owner

I'll merge this, but this appears to be a broken link? should I change it back?

Owner

timgraham commented Apr 17, 2014

Fixed link and merged in 030dd4f.

@timgraham timgraham closed this Apr 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment