BaseStorage
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.
Attributes
| Attribute | Type | Description |
|---|---|---|
| level | integer | The minimum recorded level for messages, where messages with a level lower than this value are ignored. |
Constructor
Signature
def BaseStorage(
request: object,
*args: any,
**kwargs: any
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| request | object | The request object associated with the storage. |
| *args | any | Variable length argument list passed to the parent constructor. |
| **kwargs | any | Arbitrary keyword arguments passed to the parent constructor. |
Methods
update()
@classmethod
def update(
response: [HttpResponse](../../../../http/response/httpresponse.md?sid=django_http_response_httpresponse)
) - > list
Store all unread messages. If the backend has yet to be iterated, store previously stored messages again. Otherwise, only store messages added after the last iteration.
Parameters
| Name | Type | Description |
|---|---|---|
| response | [HttpResponse](../../../../http/response/httpresponse.md?sid=django_http_response_httpresponse) | The response object used to persist the messages |
Returns
| Type | Description |
|---|---|
list | A list of messages that could not be stored |
add()
@classmethod
def add(
level: int,
message: str,
extra_tags: str = ""
) - > null
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).
Parameters
| Name | Type | Description |
|---|---|---|
| level | int | The severity level of the message (e.g., DEBUG, INFO, ERROR) |
| message | str | The actual content of the message to be stored |
| extra_tags | str = "" | A string of space-separated tags to provide additional context to the message |
Returns
| Type | Description |
|---|---|
null | null |