summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRobert Jackiewicz <rob@jackiewicz.ca>2012-11-12 12:27:23 -0500
committerRobert Jackiewicz <rob@jackiewicz.ca>2012-11-12 12:27:23 -0500
commit8818ea59e253b855e1b0f09b856560cb71c9e8de (patch)
treeccd6748907dfd54b63ad2a0a856a2f1d82ff0d8f /docs
parenta3adaeb87ceb2e7ae55bd9e56fcb0accee7c3d85 (diff)
downloadpyramid-8818ea59e253b855e1b0f09b856560cb71c9e8de.tar.gz
pyramid-8818ea59e253b855e1b0f09b856560cb71c9e8de.tar.bz2
pyramid-8818ea59e253b855e1b0f09b856560cb71c9e8de.zip
Modified the hooks documentation to currently describe how to access the context in a forbidden view.
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/hooks.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 96fa77a07..ea75e5fe4 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -180,11 +180,14 @@ as a forbidden view:
config.scan()
Like any other view, the forbidden view must accept at least a ``request``
-parameter, or both ``context`` and ``request``. The ``context`` (available
-as ``request.context`` if you're using the request-only view argument
-pattern) is the context found by the router when the view invocation was
-denied. The ``request`` is the current :term:`request` representing the
-denied action.
+parameter, or both ``context`` and ``request``. If a forbidden view
+callable accepts both ``context`` and ``request``, the HTTP Exception is passed
+as context. The ``context`` as found by the router when view was
+denied (that you normally would expect) is available as
+``request.context``. The ``request`` is the current :term:`request`
+representing the denied action.
+
+
Here's some sample code that implements a minimal forbidden view: