summaryrefslogtreecommitdiff
path: root/docs/narr/hooks.rst
diff options
context:
space:
mode:
authorJeff Cook <jeff@deserettechnology.com>2012-06-07 14:00:07 -0600
committerJeff Cook <jeff@deserettechnology.com>2012-06-07 14:00:07 -0600
commita319249fdb6e0539e65e0b297829ed8c7f799b98 (patch)
treee84ce71fbed617b89c093e8bc573dcf55229eddd /docs/narr/hooks.rst
parent566a2a641a03b2d4bec6b19e8d20148dbc2769b4 (diff)
downloadpyramid-a319249fdb6e0539e65e0b297829ed8c7f799b98.tar.gz
pyramid-a319249fdb6e0539e65e0b297829ed8c7f799b98.tar.bz2
pyramid-a319249fdb6e0539e65e0b297829ed8c7f799b98.zip
Update documentation to clarify purpose of BeforeRender.rendering_val.
Diffstat (limited to 'docs/narr/hooks.rst')
-rw-r--r--docs/narr/hooks.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index a2143b3c5..30eec04f0 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -289,6 +289,21 @@ keys added to the renderer globals dictionary by all
:class:`pyramid.events.BeforeRender` subscribers and renderer globals
factories must be unique.
+The dictionary returned from the view is accessible through the
+:attr:`rendering_val` attribute of a :class:`~pyramid.events.BeforeRender`
+event, like so:
+
+.. code-block:: python
+ :linenos:
+
+ from pyramid.events import subscriber
+ from pyramid.events import BeforeRender
+
+ @subscriber(BeforeRender)
+ def read_return(event):
+ # 'mykey' is returned from the view
+ print(event.rendering_val['mykey'])
+
See the API documentation for the :class:`~pyramid.events.BeforeRender` event
interface at :class:`pyramid.interfaces.IBeforeRender`.