class BaseStorage:
Known subclasses: django.contrib.messages.storage.cookie.CookieStorage
, django.contrib.messages.storage.fallback.FallbackStorage
, django.contrib.messages.storage.session.SessionStorage
This is the base backend for temporary message storage.
This is not a complete class; to be a usable storage backend, it must be subclassed and the two methods _get and _store overridden.
Method | __contains__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | _get |
No summary |
Method | _get_level |
Return the minimum recorded level. |
Method | _prepare_messages |
Prepare a list of messages for storage. |
Method | _set_level |
Set a custom minimum recorded level. |
Method | _store |
Store a list of messages and return a list of any messages which could not be stored. |
Method | add |
Queue a message to be stored. |
Method | update |
Store all unread messages. |
Class Variable | level |
Undocumented |
Instance Variable | _level |
Undocumented |
Instance Variable | _queued_messages |
Undocumented |
Instance Variable | added_new |
Undocumented |
Instance Variable | request |
Undocumented |
Instance Variable | used |
Undocumented |
Property | _loaded_messages |
Return a list of loaded messages, retrieving them first if they have not been loaded yet. |
django.contrib.messages.storage.cookie.CookieStorage
, django.contrib.messages.storage.fallback.FallbackStorage
, django.contrib.messages.storage.session.SessionStorage
Retrieve a list of stored messages. Return a tuple of the messages and a flag indicating whether or not all the messages originally intended to be stored in this storage were, in fact, stored and retrieved; e.g., (messages, all_retrieved).
This method must be implemented by a subclass.
If it is possible to tell if the backend was not used (as opposed to just containing no messages) then None should be returned in place of messages.
Return the minimum recorded level.
The default level is the MESSAGE_LEVEL setting. If this is not found, the INFO level is used.
Set a custom minimum recorded level.
If set to None, the default level will be used (see the _get_level method).
django.contrib.messages.storage.cookie.CookieStorage
, django.contrib.messages.storage.fallback.FallbackStorage
, django.contrib.messages.storage.session.SessionStorage
Store a list of messages and return a list of any messages which could not be stored.
One type of object must be able to be stored, Message.
This method must be implemented by a subclass.
Queue a message to be stored.
The message is only queued if it contained something and its level is not less than the recording level (self.level).