예제 #1
0
 def process_request(self, request):
     """This method is called by the Django framework when a *request* hits
     the server.
     """
     flash = storage.get(request) or FlashScope()
     flash.update()
     setattr(request, CONTEXT_VAR, flash)
예제 #2
0
def _get_flash_from_storage(request):
    """Gets the flash from the storage, adds it to the given request and
    returns it. A new :class:`FlashScope` is used if the storage is empty.
    """
    flash = storage.get(request) or FlashScope()
    setattr(request, CONTEXT_VAR, flash)
    return flash
예제 #3
0
def _get_flash_from_storage(request):
    """Gets the flash from the storage, adds it to the given request and
    returns it. A new :class:`FlashScope` is used if the storage is empty.
    """
    flash = storage.get(request) or FlashScope()
    setattr(request, CONTEXT_VAR, flash)
    return flash