Browse Source

Changes and docs are modified.

pull/1509/head
Alexander Pantyukhin 10 years ago committed by Markus Unterwaditzer
parent
commit
a9066a3756
  1. 1
      CHANGES
  2. 17
      docs/api.rst

1
CHANGES

@ -8,6 +8,7 @@ Version 1.0
(release date to be announced, codename to be selected)
- Added before_render_template signal.
- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing
additional keyword arguments to the constructor of
:attr:`flask.Flask.test_client_class`.

17
docs/api.rst

@ -538,6 +538,23 @@ The following signals exist in Flask:
from flask import template_rendered
template_rendered.connect(log_template_renders, app)
.. data:: flask.before_render_template
:noindex:
This signal is sent before template rendering process. The
signal is invoked with the instance of the template as `template`
and the context as dictionary (named `context`).
Example subscriber::
def log_template_renders(sender, template, context, **extra):
sender.logger.debug('Rendering template "%s" with context %s',
template.name or 'string template',
context)
from flask import before_render_template
before_render_template.connect(log_template_renders, app)
.. data:: request_started
This signal is sent when the request context is set up, before

Loading…
Cancel
Save