3
g              
   @   s   d dl mZ d dlmZ dZG dd deZdddZdd Zdd Z	dd Z
dddZdddZddd	Zddd
Zd ddZdS )!    )	constants)default_storageadd_messageget_messages	get_level	set_leveldebuginfosuccesswarningerrorMessageFailurec               @   s   e Zd ZdS )r   N)__name__
__module____qualname__ r   r   Y/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django/contrib/messages/api.pyr      s    Fc             C   sX   y
| j }W n: tk
rD   t| ds4td| jj |s@tdY nX |j|||S dS )zK
    Attempt to add a message to the request using the 'messages' app.
    ZMETAz?add_message() argument must be an HttpRequest object, not '%s'.z_You cannot add messages without installing django.contrib.messages.middleware.MessageMiddlewareN)	_messagesAttributeErrorhasattr	TypeError	__class__r   r   add)requestlevelmessage
extra_tagsfail_silentlymessagesr   r   r   r      s    

c             C   s   t | dg S )ze
    Return the message storage on the request if it exists, otherwise return
    an empty list.
    r   )getattr)r   r   r   r   r   %   s    c             C   s   t | dt| }|jS )z
    Return the minimum level of messages to be recorded.

    The default level is the ``MESSAGE_LEVEL`` setting. If this is not found,
    use the ``INFO`` level.
    r   )r    r   r   )r   Zstorager   r   r   r   -   s    c             C   s   t | dsdS || j_dS )z
    Set the minimum level of messages to be recorded, and return ``True`` if
    the level was recorded successfully.

    If set to ``None``, use the default level (see the get_level() function).
    r   FT)r   r   r   )r   r   r   r   r   r   8   s    
c             C   s   t | tj|||d dS )z'Add a message with the ``DEBUG`` level.)r   r   N)r   r   DEBUG)r   r   r   r   r   r   r   r   E   s    c             C   s   t | tj|||d dS )z&Add a message with the ``INFO`` level.)r   r   N)r   r   INFO)r   r   r   r   r   r   r   r	   K   s    c             C   s   t | tj|||d dS )z)Add a message with the ``SUCCESS`` level.)r   r   N)r   r   SUCCESS)r   r   r   r   r   r   r   r
   Q   s    c             C   s   t | tj|||d dS )z)Add a message with the ``WARNING`` level.)r   r   N)r   r   WARNING)r   r   r   r   r   r   r   r   W   s    c             C   s   t | tj|||d dS )z'Add a message with the ``ERROR`` level.)r   r   N)r   r   ERROR)r   r   r   r   r   r   r   r   ]   s    N)
r   r   r   r   r   r	   r
   r   r   r   )r   F)r   F)r   F)r   F)r   F)r   F)Zdjango.contrib.messagesr   Zdjango.contrib.messages.storager   __all__	Exceptionr   r   r   r   r   r   r	   r
   r   r   r   r   r   r   <module>   s      




