Kaydet (Commit) ecb56cec authored tarafından Karen Tracey's avatar Karen Tracey

Fixed #12946: Removed an invalid example of url tag usage from the docs.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 6d7754ba
...@@ -891,12 +891,18 @@ Returns an absolute URL (i.e., a URL without the domain name) matching a given ...@@ -891,12 +891,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 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:: 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 The first argument is a path to a view function in the format
``package.package.module.function``. Additional arguments are optional and ``package.package.module.function``. Additional arguments are optional and
should be comma-separated values that will be used as positional and keyword should be comma-separated values that will be used as arguments in the URL.
arguments in the URL. All arguments required by the URLconf should be present. 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 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 takes a client ID (here, ``client()`` is a method inside the views file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment