Django

Code

Changeset 5353

Show
Ignore:
Timestamp:
05/26/07 04:43:32 (1 year ago)
Author:
mtredinnick
Message:

Fixed #4355 -- Clarified a confusing example in the use of the url template
tag. Based on a patch from Collin Grady.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/templates.txt

    r5010 r5353  
    844844arguments in the URL. All arguments required by the URLconf should be present. 
    845845 
    846 For example, suppose you have a view, ``app_name.client``, whose URLconf takes 
    847 a client ID. The URLconf line might look like this:: 
    848  
    849     ('^client/(\d+)/$', 'app_name.client') 
     846For example, suppose you have a view, ``app_views.client``, whose URLconf 
     847takes a client ID (here, ``client()`` is a method inside the views file 
     848``app_views.py``). The URLconf line might look like this:: 
     849 
     850    ('^client/(\d+)/$', 'app_views.client') 
    850851 
    851852If this app's URLconf is included into the project's URLconf under a path 
     
    856857...then, in a template, you can create a link to this view like this:: 
    857858 
    858     {% url app_name.client client.id %} 
     859    {% url app_views.client client.id %} 
    859860 
    860861The template tag will output the string ``/clients/client/123/``.