mirror of
https://github.com/django-components/django-components.git
synced 2025-08-11 17:57:59 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
089cda54c5
commit
ab7f3e0cdb
5 changed files with 27 additions and 20 deletions
|
@ -20,19 +20,24 @@ from django.views import View
|
||||||
# way the two modules depend on one another.
|
# way the two modules depend on one another.
|
||||||
from django_components.component_registry import registry # NOQA
|
from django_components.component_registry import registry # NOQA
|
||||||
from django_components.component_registry import AlreadyRegistered, ComponentRegistry, NotRegistered, register # NOQA
|
from django_components.component_registry import AlreadyRegistered, ComponentRegistry, NotRegistered, register # NOQA
|
||||||
from django_components.context import capture_root_context, set_root_context, get_root_context, set_slot_component_association
|
from django_components.context import (
|
||||||
|
capture_root_context,
|
||||||
|
get_root_context,
|
||||||
|
set_root_context,
|
||||||
|
set_slot_component_association,
|
||||||
|
)
|
||||||
from django_components.logger import logger, trace_msg
|
from django_components.logger import logger, trace_msg
|
||||||
from django_components.middleware import is_dependency_middleware_active
|
from django_components.middleware import is_dependency_middleware_active
|
||||||
from django_components.node import walk_nodelist
|
from django_components.node import walk_nodelist
|
||||||
from django_components.slots import (
|
from django_components.slots import (
|
||||||
|
DEFAULT_SLOT_KEY,
|
||||||
FillContent,
|
FillContent,
|
||||||
FillNode,
|
FillNode,
|
||||||
SlotName,
|
SlotName,
|
||||||
SlotNode,
|
SlotNode,
|
||||||
render_component_template_with_slots,
|
render_component_template_with_slots,
|
||||||
DEFAULT_SLOT_KEY,
|
|
||||||
)
|
)
|
||||||
from django_components.utils import search, gen_id
|
from django_components.utils import gen_id, search
|
||||||
|
|
||||||
RENDERED_COMMENT_TEMPLATE = "<!-- _RENDERED {name} -->"
|
RENDERED_COMMENT_TEMPLATE = "<!-- _RENDERED {name} -->"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ pass data across components, nodes, slots, and contexts.
|
||||||
You can think of the Context as our storage system.
|
You can think of the Context as our storage system.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import Optional, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Optional
|
||||||
|
|
||||||
from django.template import Context
|
from django.template import Context
|
||||||
|
|
||||||
|
|
|
@ -9,15 +9,15 @@ else:
|
||||||
from typing import TypeAlias
|
from typing import TypeAlias
|
||||||
|
|
||||||
from django.template import Context, Template
|
from django.template import Context, Template
|
||||||
from django.template.base import FilterExpression, Node, NodeList, TextNode, Parser
|
from django.template.base import FilterExpression, Node, NodeList, Parser, TextNode
|
||||||
from django.template.defaulttags import CommentNode
|
from django.template.defaulttags import CommentNode
|
||||||
from django.template.exceptions import TemplateSyntaxError
|
from django.template.exceptions import TemplateSyntaxError
|
||||||
from django.utils.safestring import SafeString, mark_safe
|
from django.utils.safestring import SafeString, mark_safe
|
||||||
|
|
||||||
from django_components.app_settings import SlotContextBehavior, app_settings
|
from django_components.app_settings import SlotContextBehavior, app_settings
|
||||||
from django_components.context import get_root_context, get_slot_fill, set_slot_fill, get_slot_component_association
|
from django_components.context import get_root_context, get_slot_component_association, get_slot_fill, set_slot_fill
|
||||||
from django_components.node import nodelist_has_content
|
|
||||||
from django_components.logger import trace_msg
|
from django_components.logger import trace_msg
|
||||||
|
from django_components.node import nodelist_has_content
|
||||||
from django_components.utils import gen_id
|
from django_components.utils import gen_id
|
||||||
|
|
||||||
DEFAULT_SLOT_KEY = "_DJANGO_COMPONENTS_DEFAULT_SLOT"
|
DEFAULT_SLOT_KEY = "_DJANGO_COMPONENTS_DEFAULT_SLOT"
|
||||||
|
@ -62,6 +62,7 @@ class ComponentIdMixin:
|
||||||
We use component IDs to identify which slots should be
|
We use component IDs to identify which slots should be
|
||||||
rendered with which fills for which components.
|
rendered with which fills for which components.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_component_id: str
|
_component_id: str
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -537,6 +537,7 @@ class ComponentIsolationTests(SimpleTestCase):
|
||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SlotBehaviorTests(SimpleTestCase):
|
class SlotBehaviorTests(SimpleTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
class SlottedComponent(component.Component):
|
class SlottedComponent(component.Component):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue