summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-01-17 18:26:09 +0000
committerChris McDonough <chrism@agendaless.com>2010-01-17 18:26:09 +0000
commitb861a5ebaa6adae3ab102cb5656a1ae9b9f115e8 (patch)
tree4f75a5a86ab18e230f0fd0327785326116c05cf2
parent38b33d485322759050510c96a75334e36ca63c30 (diff)
downloadpyramid-b861a5ebaa6adae3ab102cb5656a1ae9b9f115e8.tar.gz
pyramid-b861a5ebaa6adae3ab102cb5656a1ae9b9f115e8.tar.bz2
pyramid-b861a5ebaa6adae3ab102cb5656a1ae9b9f115e8.zip
Checklist.
-rw-r--r--TODO.txt2
-rw-r--r--docs/narr/views.rst14
2 files changed, 14 insertions, 2 deletions
diff --git a/TODO.txt b/TODO.txt
index ec33b7709..ea4d0d204 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -15,8 +15,6 @@
- Add an example of URL match ordering when routes compete to the
urldispatch chapter.
-- Add an example of varying the attributes of a renderered response (7.1.8).
-
- Review tutorials.
- Review index.
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