Small style cleanup of docs/generic_views.txt

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1256 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-11-16 00:25:48 +00:00
parent 991039dd1e
commit 2d49f70b0d
1 changed files with 12 additions and 11 deletions

View File

@ -76,8 +76,9 @@ couple of common cases: rendering a template when no view logic is needed,
and issuing a redirect. These views are: and issuing a redirect. These views are:
``direct_to_template`` ``direct_to_template``
Renders a given template using any extra parameters passed in the Renders a given template, passing it a ``{{ params }}`` template variable,
urlpattern; requires the ``template`` argument. which is a dictionary of the parameters captured in the URL. This requires
the ``template`` argument.
For example, given the following URL patterns:: For example, given the following URL patterns::
@ -94,7 +95,7 @@ and issuing a redirect. These views are:
``redirect_to`` ``redirect_to``
Issue a redirect to a given URL. Issue a redirect to a given URL.
The given url may contain dict-style string formatting which will be The given URL may contain dict-style string formatting, which will be
interpolated against the params in the URL. For example, to redirect from interpolated against the params in the URL. For example, to redirect from
``/foo/<id>/`` to ``/bar/<id>/``, you could use the following urlpattern:: ``/foo/<id>/`` to ``/bar/<id>/``, you could use the following urlpattern::
@ -102,7 +103,7 @@ and issuing a redirect. These views are:
('^foo/(?p<id>\d+)/$', 'redirect_to', {'url' : '/bar/%(id)s/'}), ('^foo/(?p<id>\d+)/$', 'redirect_to', {'url' : '/bar/%(id)s/'}),
) )
If the given url is ``None``, a HttpResponseGone (410) will be issued. If the given URL is ``None``, an ``HttpResponseGone`` (410) will be issued.
Using date-based generic views Using date-based generic views
============================== ==============================