summaryrefslogtreecommitdiff
path: root/docs/api/events.rst
AgeCommit message (Collapse)Author
2016-04-10Add API docs for BeforeTraversalBert JW Regeer
2011-08-14- Added the ``pyramid.interfaces.IDict`` interface representing the methodsChris McDonough
of a dictionary, for documentation purposes only (IMultiDict and IBeforeRender inherit from it). - Previously the ``pyramid.events.BeforeRender`` event *wrapped* a dictionary (it addressed it as its ``_system`` attribute). Now it *is* a dictionary (it inherits from ``dict``), and it's the value that is passed to templates as a top-level dictionary.
2010-11-02- New event type: ``pyramid.interfaces.IBeforeRender``. An object of this typeChris McDonough
is sent as an event before a renderer is invoked (but after the application-level renderer globals factory added via ``pyramid.configurator.configuration.set_renderer_globals_factory``, if any, has injected its own keys). Applications may now subscribe to the ``IBeforeRender`` event type in order to introspect the and modify the set of renderer globals before they are passed to a renderer. The event object iself has a dictionary-like interface that can be used for this purpose. For example:: from repoze.events import subscriber from pyramid.interfaces import IRendererGlobalsEvent @subscriber(IRendererGlobalsEvent) def add_global(event): event['mykey'] = 'foo' If a subscriber attempts to add a key that already exist in the renderer globals dictionary, a ``KeyError`` is raised. This limitation is due to the fact that subscribers cannot be ordered relative to each other. The set of keys added to the renderer globals dictionary by all subscribers and app-level globals factories must be unique.
2010-10-25convert API docs to PyramidChris McDonough
2010-09-12remove FinishedEvent (bad idea)Chris McDonough
2010-09-12- The BFG router now emits an additional event unconditionally at theChris McDonough
end of request processing: ``repoze.bfg.interfaces.IFinishedRequest``. This event is meant to be used when it is necessary to perform unconditional cleanup after request processing. See the ``repoze.bfg.events.FinishedRequest`` class documentation for more information. - The ``repoze.bfg.interfaces.IWSGIApplicationCreatedEvent`` event interface was renamed to ``repoze.bfg.interfaces.IApplicationCreated``. Likewise, the ``repoze.bfg.events.WSGIApplicationCreatedEvent`` class was renamed to ``repoze.bfg.events.ApplicationCreated``. The older aliases will continue to work indefinitely. - The ``repoze.bfg.interfaces.IAfterTraversal`` event interface was renamed to ``repoze.bfg.interfaces.IContextFound``. Likewise, the ``repoze.bfg.events.AfterTraveral`` class was renamed to ``repoze.bfg.events.ContextFound``. The older aliases will continue to work indefinitely.
2010-07-28- A ``repoze.bfg.events.subscriber`` decorator was added. ThisChris McDonough
decorator decorates module-scope functions, which are then treated as event listeners after a scan() is performed. See the Events narrative documentation chapter and the ``repoze.bfg.events`` module documentation for more information.
2008-08-29Rejigger and document wsgi app created event.Chris McDonough
2008-08-04 - Add a ``request_type`` attribute to the available attributes of aChris McDonough
``bfg:view`` configure.zcml element. This attribute will have a value which is a dotted Python path, pointing at an interface. If the request object implements this interface when the view lookup is performed, the appropriate view will be called. - Remove "template only" views. These were just confusing and were never documented.
2008-07-31 - Add event sends for INewRequest and INewResponse. See theChris McDonough
events.rst chapter in the documentation's ``api`` directory.