From b861a5ebaa6adae3ab102cb5656a1ae9b9f115e8 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 17 Jan 2010 18:26:09 +0000 Subject: Checklist. --- docs/narr/views.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs') diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 3454299a1..9af12dd4e 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -557,6 +557,20 @@ callable to influence associated response attributes. achieved by returning various values in the ``response_headerlist``, this is purely a convenience. +For example, if you need to change the response status from within a +view callable that uses a renderer, assign the ``response_status`` +attribute to the request before returning a result: + +.. code-block:: python + :linenos: + + from repoze.bfg.view import bfg_view + + @bfg_view(name='gone') + def myview(request): + request.response_status = '404 Not Found' + return {'URL':request.URL} + .. index:: pair: renderers; adding -- cgit v1.2.3