Clarified the documentation of the kwargs param to django.conf.urls.url() #2480

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

timmartin commented Mar 25, 2014

The reference documentation for the url() function now links to the example
elsewhere in the documentation.

The explanation of URL processing explains how the kwargs parameter is
combined with the results of the regexp match

docs/ref/urls.txt
@@ -76,6 +76,10 @@ This function takes five arguments, most of which are optional::
url(regex, view, kwargs=None, name=None, prefix='')
+The ``kwargs`` parameter allows you to pass additional arguments to the view
+function. See :ref:`Passing extra options to view
@timgraham

timgraham Mar 26, 2014

Owner
  1. What about class based views?
  2. The link can simply be :ref:views-extra-options since the desired text is not different from the section title in this case.
docs/topics/http/urls.txt
+ </topics/class-based-views/index>`). The view gets passed the following
+ arguments:
+
+ * An instance of :class:`~django.http.HttpRequest`
@timgraham

timgraham Mar 26, 2014

Owner

add period to match other bullets

docs/topics/http/urls.txt
+ arguments:
+
+ * An instance of :class:`~django.http.HttpRequest`
+ * If the matched regular expression returned no named groups, the matches
@timgraham

timgraham Mar 26, 2014

Owner

then the matches...

docs/topics/http/urls.txt
+
+ * An instance of :class:`~django.http.HttpRequest`
+ * If the matched regular expression returned no named groups, the matches
+ from the regular expression are provided as positional parameters.
@timgraham

timgraham Mar 26, 2014

Owner

parameters -> arguments
(A parameter is the variable which is part of the method’s signature (method declaration). An argument is an expression used when calling the method.)

Owner

timgraham commented Mar 26, 2014

Please note our commit message guidelines (include ticket number). Thanks!

@timgraham timgraham closed this Mar 26, 2014

@timgraham timgraham reopened this Mar 26, 2014

Fixed #21941 -- documentation of kwargs param on django.conf.urls.url()
The reference documentation for the url() function now links to the example
elsewhere in the documentation.
The explanation of URL processing explains how the kwargs parameter is
combined with the results of the regexp match
Contributor

timmartin commented Mar 26, 2014

I addressed these comments and rebased the branch to fix the commit message, which meant force-pushing. I couldn't find any documentation about whether this prevent the pull request from applying cleanly, so let me know if I need to recreate it.

Owner

timgraham commented Mar 27, 2014

Nope, that's fine, merge in a779757. I tweaked the commit message as follows:

Fixed #21941 -- Documented the kwargs param of django.conf.urls.url().

Thanks cjerdonek for the report.

Thanks!

@timgraham timgraham closed this Mar 27, 2014

@timmartin timmartin deleted the timmartin:bug21941 branch Jun 1, 2014

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