ó
TR¹Nc           @   s*   d  d l  m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   BaseStoraget   SessionStoragec           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   sL   
    Stores messages in the session (that is, django.contrib.sessions).
    t	   _messagesc         O   s8   t  | d ƒ s t d ‚ t t |  ƒ j | | | Ž d  S(   Nt   sessionsŸ   The session-based temporary message storage requires session middleware to be installed, and come before the message middleware in the MIDDLEWARE_CLASSES list.(   t   hasattrt   AssertionErrort   superR   t   __init__(   t   selft   requestt   argst   kwargs(    (    sT   /home/panlixing/Python_Projects/gaeseries/django/contrib/messages/storage/session.pyR   
   s    c         O   s   |  j  j j |  j ƒ t f S(   s¹   
        Retrieves a list of messages from the request's session.  This storage
        always stores everything it is given, so return True for the
        all_retrieved flag.
        (   R	   R   t   gett   session_keyt   True(   R   R
   R   (    (    sT   /home/panlixing/Python_Projects/gaeseries/django/contrib/messages/storage/session.pyt   _get   s    c         O   s9   | r | |  j  j |  j <n |  j  j j |  j d ƒ g  S(   sE   
        Stores a list of messages to the request's session.
        N(   R	   R   R   t   popt   None(   R   t   messagest   responseR
   R   (    (    sT   /home/panlixing/Python_Projects/gaeseries/django/contrib/messages/storage/session.pyt   _store   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   (    (    (    sT   /home/panlixing/Python_Projects/gaeseries/django/contrib/messages/storage/session.pyR      s
   		N(   t$   django.contrib.messages.storage.baseR    R   (    (    (    sT   /home/panlixing/Python_Projects/gaeseries/django/contrib/messages/storage/session.pyt   <module>   s   