
    Evg                         d dl mZ d dlmZ dZ G d de          ZddZd	 Zd
 Z	d Z
ddZddZddZddZddZdS )    )	constants)default_storage)
add_messageget_messages	get_level	set_leveldebuginfosuccesswarningerrorMessageFailurec                       e Zd ZdS )r   N)__name__
__module____qualname__     X/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/contrib/messages/api.pyr   r      s        Dr   r    Fc                     	 | j         }|                    |||          S # t          $ rA t          | d          st	          d| j        j        z            |st          d          Y dS w xY w)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addAttributeErrorhasattr	TypeError	__class__r   r   )requestlevelmessage
extra_tagsfail_silentlymessagess         r   r   r      s    8$ ||E7J777  
 
 
w'' 	!+45    	 G  	 	 	
s     AA+*A+c                 $    t          | dg           S )ze
    Return the message storage on the request if it exists, otherwise return
    an empty list.
    r   )getattr)r   s    r   r   r   +   s    
 7K,,,r   c                 L    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   storages     r   r   r   3   s%     g{OG,D,DEEG=r   c                 B    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    s     r   r   r   >   s+     7K(( u#G4r   c                 B    t          | t          j        |||           dS )z'Add a message with the ``DEBUG`` level.r"   r#   N)r   r   DEBUGr   r!   r"   r#   s       r   r	   r	   K   4    #     r   c                 B    t          | t          j        |||           dS )z&Add a message with the ``INFO`` level.r+   N)r   r   INFOr-   s       r   r
   r
   V   s4    #     r   c                 B    t          | t          j        |||           dS )z)Add a message with the ``SUCCESS`` level.r+   N)r   r   SUCCESSr-   s       r   r   r   a   5    #     r   c                 B    t          | t          j        |||           dS )z)Add a message with the ``WARNING`` level.r+   N)r   r   WARNINGr-   s       r   r   r   l   r3   r   c                 B    t          | t          j        |||           dS )z'Add a message with the ``ERROR`` level.r+   N)r   r   ERRORr-   s       r   r   r   w   r.   r   N)r   F)django.contrib.messagesr   django.contrib.messages.storager   __all__	Exceptionr   r   r   r   r   r	   r
   r   r   r   r   r   r   <module>r<      s	   - - - - - - ; ; ; ; ; ;	 	 	 	 	Y 	 	 	8 8 8 8*- - -  
 
 
                 r   