2 Lightweight session-based messaging system for use until #4604 finally lands.
4 Time-stamp: <2008-07-19 22:44:56 carljm __init__.py>
7 VERSION
= (0, 1, 'pre')
9 def create_message (request
, message
):
11 Create a message in the current session.
13 Return True if message was saved in session, or False if it
14 couldn't be (likely because session framework is not in
18 if hasattr(request
, 'session'):
20 request
.session
['messages'].append(message
)
22 request
.session
['messages'] = [message
]
26 def get_and_delete_messages (request
):
28 Get and delete all messages for current session.
31 if hasattr(request
, 'session'):
32 return request
.session
.pop('messages', [])