o ǎ_ @sddlmZddlmZdZGdddeZddd Zd d Zd d Z ddZ dddZ dddZ dddZ dddZdddZdS)) constants)default_storage) add_message get_messages get_level set_leveldebuginfosuccesswarningerrorMessageFailurec@s eZdZdS)r N)__name__ __module__ __qualname__rr=/usr/lib/python3/dist-packages/django/contrib/messages/api.pyr sr FcCsTz|j}Wnty"t|dstd|jj|stdYdSw||||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) _messagesAttributeErrorhasattr TypeError __class__rr add)requestlevelmessage extra_tags fail_silentlymessagesrrrrs     rcCs t|dgS)ze Return the message storage on the request if it exists, otherwise return an empty list. r)getattr)rrrrr%s rcCst|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!rr)rstoragerrrr-srcCst|dsdS||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). rFT)rrr)rrrrrr8s rcCt|tj|||ddS)z'Add a message with the ``DEBUG`` level.rrN)rrDEBUGrrrrrrrrE  rcCr#)z&Add a message with the ``INFO`` level.r$N)rrINFOr&rrrr Kr'r cCr#)z)Add a message with the ``SUCCESS`` level.r$N)rrSUCCESSr&rrrr Qr'r cCr#)z)Add a message with the ``WARNING`` level.r$N)rrWARNINGr&rrrr Wr'r cCr#)z'Add a message with the ``ERROR`` level.r$N)rrERRORr&rrrr ]r'r N)rF)django.contrib.messagesrdjango.contrib.messages.storager__all__ Exceptionr rrrrrr r r r rrrrs