File: //usr/lib/python3/dist-packages/django/contrib/messages/__pycache__/api.cpython-310.pyc
o
ǎ�_� � @ s� d dl mZ d dlmZ dZG dd� de�Zddd �Zd
d� Zdd
� Z dd� Z
ddd�Zddd�Zddd�Z
ddd�Zddd�ZdS )� )� constants)�default_storage)
�add_message�get_messages� get_level� set_level�debug�info�success�warning�error�MessageFailurec @ s e Zd ZdS )r
N)�__name__�
__module__�__qualname__� r r �=/usr/lib/python3/dist-packages/django/contrib/messages/api.pyr
s r
� Fc C sT z| j }W n ty" t| d�std| jj ��|std��Y dS w |�|||�S )zK
Attempt to add a message to the request using the 'messages' app.
�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
�����r c C s t | dg �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 r c C s t | dt| ��}|jS )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 �storager r r r - s r c C s t | d�sdS || j_dS )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
r c C � t | tj|||d� dS )z'Add a message with the ``DEBUG`` level.�r r N)r r �DEBUG�r r r r r r r r E �
�r c C r# )z&Add a message with the ``INFO`` level.r$ N)r r �INFOr&