summaryrefslogtreecommitdiff
path: root/docs/narr/flash.rst
diff options
context:
space:
mode:
authorRob Miller <rob@mochimedia.com>2010-12-29 14:12:30 -0800
committerRob Miller <rob@mochimedia.com>2010-12-29 14:12:30 -0800
commit9c1d34a3de11286c98dce52592ef05a3c05046a5 (patch)
tree3b9d60fabfa876bdaba9debd477f85cd9cf926bf /docs/narr/flash.rst
parent88231cc1b16f1f5a0983dba1dab9b401bbde0c00 (diff)
parent8739f576ed84bb48cec9c2d4b60e92878a273b1f (diff)
downloadpyramid-9c1d34a3de11286c98dce52592ef05a3c05046a5.tar.gz
pyramid-9c1d34a3de11286c98dce52592ef05a3c05046a5.tar.bz2
pyramid-9c1d34a3de11286c98dce52592ef05a3c05046a5.zip
Merge remote branch 'refs/remotes/upstream/viewderiver' into ra_view_decoration
Conflicts: CHANGES.txt pyramid/config.py
Diffstat (limited to 'docs/narr/flash.rst')
-rw-r--r--docs/narr/flash.rst14
1 files changed, 9 insertions, 5 deletions
diff --git a/docs/narr/flash.rst b/docs/narr/flash.rst
index d41c2cdaf..037bfc416 100644
--- a/docs/narr/flash.rst
+++ b/docs/narr/flash.rst
@@ -38,7 +38,7 @@ provide is not modified in any way.
The ``queue`` argument allows you to choose a queue to which to append the
message you provide. This can be used to push different kinds of messages
-into flash storage for later display in different places on a page. You cam
+into flash storage for later display in different places on a page. You can
pass any name for your queue, but it must be a string. The default value is
the empty string, which chooses the default queue. Each queue is independent,
and can be popped by ``pop_flash`` or examined via ``peek_flash`` separately.
@@ -49,20 +49,22 @@ default flash message queue.
request.session.flash(msg, 'myappsqueue')
-The ``allow_duplicate`` argument, which defaults to ``True``. If this is
+The ``allow_duplicate`` argument defaults to ``True``. If this is
``False``, if you attempt to add a message to a queue which is already
present in the queue, it will not be added.
Using the ``session.pop_flash`` Method
--------------------------------------
-Once one or more messages has been added to a flash queue by the
+Once one or more messages have been added to a flash queue by the
``session.flash`` API, the ``session.pop_flash`` API can be used to pop that
queue and return it for use.
To pop a particular queue of messages from the flash object, use the session
object's ``pop_flash`` method.
+.. method:: pop_flash(queue='')
+
.. code-block:: python
:linenos:
@@ -85,14 +87,16 @@ been popped.
The object returned from ``pop_flash`` is a list.
-Using the ``session.pop_flash`` Method
---------------------------------------
+Using the ``session.peek_flash`` Method
+---------------------------------------
Once one or more messages has been added to a flash queue by the
``session.flash`` API, the ``session.peek_flash`` API can be used to "peek"
at that queue. Unlike ``session.pop_flash``, the queue is not popped from
flash storage.
+.. method:: peek_flash(queue='')
+
.. code-block:: python
:linenos: