diff options
| author | Carlos de la Guardia <cguardia@yahoo.com> | 2011-11-11 21:43:33 -0600 |
|---|---|---|
| committer | Carlos de la Guardia <cguardia@yahoo.com> | 2011-11-11 21:43:33 -0600 |
| commit | 4382771853363858629fe851581814089ca9350d (patch) | |
| tree | 95d9339c80b34036c9efb740508d81f30b217874 | |
| parent | 2c44394a496ec2c9caa7362d7e37e5f414c860bd (diff) | |
| download | pyramid-4382771853363858629fe851581814089ca9350d.tar.gz pyramid-4382771853363858629fe851581814089ca9350d.tar.bz2 pyramid-4382771853363858629fe851581814089ca9350d.zip | |
Fix some typos and restructure text a bit
| -rw-r--r-- | pyramid/events.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/pyramid/events.py b/pyramid/events.py index 5ef60ea89..b86aa871a 100644 --- a/pyramid/events.py +++ b/pyramid/events.py @@ -167,7 +167,7 @@ WSGIApplicationCreatedEvent = ApplicationCreated # b/c (as of 1.0) @implementer(IBeforeRender) class BeforeRender(dict): """ - Subscribers to this event may introspect the and modify the set of + Subscribers to this event may introspect and modify the set of :term:`renderer globals` before they are passed to a :term:`renderer`. This event object iself has a dictionary-like interface that can be used for this purpose. For example:: @@ -185,16 +185,15 @@ class BeforeRender(dict): :class:`pyramid.config.Configurator.set_renderer_globals_factory`, if any, has injected its own keys into the renderer globals dictionary). - If a subscriber adds a key via ``__setitem__`` or that already exists in - the renderer globals dictionary, it will overwrite an older value that is - already in the globals dictionary. This can be problematic because event - subscribers to the BeforeRender event do not possess any relative - ordering. For maximum interoperability with other third-party - subscribers, if you write an event subscriber meant to be used as a - BeforeRender subscriber, your subscriber code will need to (using - ``.get`` or ``__contains__`` of the event object) ensure no value already - exists in the renderer globals dictionary before setting an overriding - value. + If a subscriber adds a key via ``__setitem__`` that already exists in + the renderer globals dictionary, it will overwrite the older value there. + This can be problematic because event subscribers to the BeforeRender + event do not possess any relative ordering. For maximum interoperability + with other third-party subscribers, if you write an event subscriber meant + to be used as a BeforeRender subscriber, your subscriber code will need to + ensure no value already exists in the renderer globals dictionary before + setting an overriding value (which can be done using ``.get`` or + ``__contains__`` of the event object). The event has an additional attribute named ``rendering_val``. This is the (non-system) value returned by a view or passed to ``render*`` as |
