mirror of
https://github.com/django-components/django-components.git
synced 2025-08-10 09:17: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
9d9462162a
commit
7fbccbf009
3 changed files with 5 additions and 10 deletions
|
@ -22,12 +22,7 @@ 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.logger import logger
|
from django_components.logger import logger
|
||||||
from django_components.middleware import is_dependency_middleware_active
|
from django_components.middleware import is_dependency_middleware_active
|
||||||
from django_components.slots import (
|
from django_components.slots import FillContent, FillNode, SlotName, render_component_template_with_slots
|
||||||
FillNode,
|
|
||||||
FillContent,
|
|
||||||
SlotName,
|
|
||||||
render_component_template_with_slots,
|
|
||||||
)
|
|
||||||
from django_components.utils import search
|
from django_components.utils import search
|
||||||
|
|
||||||
RENDERED_COMMENT_TEMPLATE = "<!-- _RENDERED {name} -->"
|
RENDERED_COMMENT_TEMPLATE = "<!-- _RENDERED {name} -->"
|
||||||
|
|
|
@ -14,7 +14,7 @@ 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
|
||||||
|
@ -176,7 +176,7 @@ class FillNode(Node):
|
||||||
"You are probably seeing this because you have used one outside "
|
"You are probably seeing this because you have used one outside "
|
||||||
"a {% component %} context."
|
"a {% component %} context."
|
||||||
)
|
)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"<{type(self)} Name: {self.name_fexp}. Contents: {repr(self.nodelist)}.>"
|
return f"<{type(self)} Name: {self.name_fexp}. Contents: {repr(self.nodelist)}.>"
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ def _try_parse_as_default_fill(
|
||||||
return [
|
return [
|
||||||
FillNode(
|
FillNode(
|
||||||
nodelist=nodelist,
|
nodelist=nodelist,
|
||||||
name_fexp=FilterExpression(json.dumps(DEFAULT_SLOT_KEY), Parser('')),
|
name_fexp=FilterExpression(json.dumps(DEFAULT_SLOT_KEY), Parser("")),
|
||||||
is_implicit=True,
|
is_implicit=True,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
|
@ -16,10 +16,10 @@ from django_components.middleware import (
|
||||||
is_dependency_middleware_active,
|
is_dependency_middleware_active,
|
||||||
)
|
)
|
||||||
from django_components.slots import (
|
from django_components.slots import (
|
||||||
|
FillNode,
|
||||||
IfSlotFilledConditionBranchNode,
|
IfSlotFilledConditionBranchNode,
|
||||||
IfSlotFilledElseBranchNode,
|
IfSlotFilledElseBranchNode,
|
||||||
IfSlotFilledNode,
|
IfSlotFilledNode,
|
||||||
FillNode,
|
|
||||||
SlotNode,
|
SlotNode,
|
||||||
_IfSlotFilledBranchNode,
|
_IfSlotFilledBranchNode,
|
||||||
parse_slot_fill_nodes_from_component_nodelist,
|
parse_slot_fill_nodes_from_component_nodelist,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue