diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2010-03-02 04:06:21 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2010-03-02 04:06:21 +0000 |
| commit | a6225393c259f7c188c84897282838ebc224a489 (patch) | |
| tree | 8e735ea97cf820bb0113dcad660c50cdd0ea9e6f /docs | |
| parent | 69fb5c25bdabd6f693bca64bcf0dfeeb9659bddf (diff) | |
[1.1.X] Fixed #12946: Removed an invalid example of url tag usage from the docs.
r12652 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index cefd3fbb2e..48f7f6caeb 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -750,12 +750,18 @@ Returns an absolute URL (i.e., a URL without the domain name) matching a given view function and optional parameters. This is a way to output links without violating the DRY principle by having to hard-code URLs in your templates:: - {% url path.to.some_view arg1,arg2,name1=value1 %} + {% url path.to.some_view v1,v2 %} The first argument is a path to a view function in the format ``package.package.module.function``. Additional arguments are optional and -should be comma-separated values that will be used as positional and keyword -arguments in the URL. All arguments required by the URLconf should be present. +should be comma-separated values that will be used as arguments in the URL. +The example above shows passing positional arguments. Alternatively you may +use keyword syntax:: + + {% url path.to.some_view arg1=v1,arg2=v2 %} + +Do not mix both positional and keyword syntax in a single call. All arguments +required by the URLconf should be present. For example, suppose you have a view, ``app_views.client``, whose URLconf takes a client ID (here, ``client()`` is a method inside the views file |
