Skip to content

Commit

Permalink
Documented new signal message_flashed
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Mar 21, 2013
1 parent 5997890 commit 4366bb3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Release date to be decided.
as intended with domain names.
- Changed logic for picking defaults for cookie values from sessions
to work better with Google Chrome.
- Added `message_flashed` signal that simplifies flashing testing.

Version 0.9
-----------
Expand Down
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,14 @@ Signals
An `exc` keyword argument is passed with the exception that caused the
teardown.

.. data:: message_flashed

This signal is sent when the application is flashing a message. The
messages is sent as `message` keyword argument and the category as
`category`.

.. versionadded:: 0.10

.. currentmodule:: None

.. class:: flask.signals.Namespace
Expand Down
18 changes: 18 additions & 0 deletions docs/signals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,22 @@ The following signals exist in Flask:
This will also be passed an `exc` keyword argument that has a reference
to the exception that caused the teardown if there was one.

.. data:: flask.message_flashed
:noindex:

This signal is sent when the application is flashing a message. The
messages is sent as `message` keyword argument and the category as
`category`.

Example subscriber::

recorded = []
def record(sender, message, category, **extra):
recorded.append((message, category))

from flask import message_flashed
message_flashed.connect(record, app)

.. versionadded:: 0.10

.. _blinker: http://pypi.python.org/pypi/blinker

0 comments on commit 4366bb3

Please sign in to comment.