mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Refs #34730 -- Made Message importable from django.contrib.messages.
This commit is contained in:
parent
1081d24f99
commit
b7fe36ad37
@ -1,2 +1,3 @@
|
||||
from django.contrib.messages.api import * # NOQA
|
||||
from django.contrib.messages.constants import * # NOQA
|
||||
from django.contrib.messages.storage.base import Message # NOQA
|
||||
|
@ -238,7 +238,7 @@ instance of the configured storage backend.
|
||||
The ``Message`` class
|
||||
---------------------
|
||||
|
||||
.. class:: storage.base.Message
|
||||
.. class:: Message
|
||||
|
||||
When you loop over the list of messages in a template, what you get are
|
||||
instances of the ``Message`` class. They have only a few attributes:
|
||||
|
@ -464,9 +464,8 @@ Minor features
|
||||
* The :ref:`messages context processor <message-displaying>` now adds a
|
||||
dictionary of default levels under the name ``DEFAULT_MESSAGE_LEVELS``.
|
||||
|
||||
* :class:`~django.contrib.messages.storage.base.Message` objects now have a
|
||||
``level_tag`` attribute that contains the string representation of the
|
||||
message level.
|
||||
* :class:`~django.contrib.messages.Message` objects now have a ``level_tag``
|
||||
attribute that contains the string representation of the message level.
|
||||
|
||||
:mod:`django.contrib.redirects`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -1,8 +1,7 @@
|
||||
from django.contrib.messages import constants, get_level, set_level
|
||||
from django.contrib.messages import Message, constants, get_level, set_level
|
||||
from django.contrib.messages.api import MessageFailure
|
||||
from django.contrib.messages.constants import DEFAULT_LEVELS
|
||||
from django.contrib.messages.storage import default_storage
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
from django.test import modify_settings, override_settings
|
||||
from django.urls import reverse
|
||||
|
@ -3,8 +3,7 @@ import random
|
||||
from unittest import TestCase
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.messages import constants
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.contrib.messages import Message, constants
|
||||
from django.contrib.messages.storage.cookie import (
|
||||
CookieStorage,
|
||||
MessageDecoder,
|
||||
|
@ -1,5 +1,4 @@
|
||||
from django.contrib.messages import constants
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.contrib.messages import Message, constants
|
||||
from django.contrib.messages.storage.session import SessionStorage
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.http import HttpRequest
|
||||
|
@ -1,8 +1,7 @@
|
||||
from unittest import mock
|
||||
|
||||
from django.contrib.messages import constants
|
||||
from django.contrib.messages import Message, constants
|
||||
from django.contrib.messages.storage import base
|
||||
from django.contrib.messages.storage.base import Message
|
||||
from django.test import SimpleTestCase, override_settings
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user