#NEWLINE# @ contextfunction #NEWLINE# def flash_messages( context ) : #NEWLINE# #INDENT# 'Retrieves the flash messages from the controller.\n\n    Example:\n\n    .. code-block:: python\n\n        {{ flash_messages() }}\n    ' #NEWLINE# app_context = context [ 'context' ] #NEWLINE# if ( 'flash_messages' not in app_context ) : #NEWLINE# #INDENT# if ( ( 'request' in app_context ) and app_context [ 'request' ] . session ) : #NEWLINE# #INDENT# app_context [ 'flash_messages' ] = controllers . FlashMessagesContainer ( app_context [ 'request' ] . session ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# app_context [ 'flash_messages' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# return context [ 'context' ] [ 'flash_messages' ]