diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-12-25 04:35:15 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-12-25 04:35:15 +0000 |
| commit | 82726d3b4308d4ccc0cfc4632e0c32c0061428e7 (patch) | |
| tree | 87b237b42bd2f19a2fb8bf99a7abfcd82dd99af3 /docs | |
| parent | ca866fc134c9640c1df17b4253544c4362143a9c (diff) | |
| download | pyramid-82726d3b4308d4ccc0cfc4632e0c32c0061428e7.tar.gz pyramid-82726d3b4308d4ccc0cfc4632e0c32c0061428e7.tar.bz2 pyramid-82726d3b4308d4ccc0cfc4632e0c32c0061428e7.zip | |
Normalize code blocks.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/views.rst | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/docs/narr/views.rst b/docs/narr/views.rst index faa9d87a6..13b73b28e 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -243,7 +243,9 @@ class as a response, no renderer will be employed. :linenos: from webob.exc import HTTPFound - return HTTPFound(location='http://example.com') # renderer avoided + + def view(request): + return HTTPFound(location='http://example.com') # renderer avoided Additional renderers can be added to the system as necessary via a ZCML directive (see :ref:`adding_and_overriding_renderers`). @@ -680,8 +682,8 @@ Or replaces the need to add this imperative configuration stanza: .. code-block:: python :linenos: - config.add_view(name='my_view', request_method='POST', for_=MyModel, - permission='read') + config.add_view(name='my_view', request_method='POST', for_=MyModel, + permission='read') All arguments to :class:`repoze.bfg.view.bfg_view` are optional. Every argument to :class:`repoze.bfg.view.bfg_view` matches the @@ -815,12 +817,12 @@ separate view registration. For example: .. code-block:: python :linenos: - from repoze.bfg.view import bfg_view + from repoze.bfg.view import bfg_view - @bfg_view(name='edit') - @bfg_view(name='change') - def edit(request): - pass + @bfg_view(name='edit') + @bfg_view(name='change') + def edit(request): + pass This registers the same view under two different names. @@ -856,6 +858,7 @@ implied by the decorator being used against the ``amethod`` method could be spelled equivalently as the below: .. code-block:: python + :linenos: from webob import Response from repoze.bfg.view import bfg_view |
