forked from orbit-oss/flask
Documented new signal message_flashed
This commit is contained in:
parent
5997890c69
commit
4366bb392a
3 changed files with 27 additions and 0 deletions
1
CHANGES
1
CHANGES
|
|
@ -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
|
||||
-----------
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue