From 1b754eb143191ce187bbdb91bf31bd718ad22cc7 Mon Sep 17 00:00:00 2001 From: Tibor Leupold Date: Sun, 18 Feb 2024 11:19:17 -0800 Subject: [PATCH] Rename registration function --- laces/components.py | 2 +- laces/test/example/components.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/laces/components.py b/laces/components.py index 439a476..b8d3406 100644 --- a/laces/components.py +++ b/laces/components.py @@ -109,7 +109,7 @@ def media(self) -> Media: _servables = {} -def servable(name: str) -> "Callable[[type[Component]], type[Component]]": +def register_servable(name: str) -> "Callable[[type[Component]], type[Component]]": def decorator(component_class: type[Component]) -> type[Component]: _servables[name] = component_class return component_class diff --git a/laces/test/example/components.py b/laces/test/example/components.py index f650567..5731a4c 100644 --- a/laces/test/example/components.py +++ b/laces/test/example/components.py @@ -10,7 +10,7 @@ from django.utils.html import format_html -from laces.components import Component, servable +from laces.components import Component, register_servable if TYPE_CHECKING: @@ -21,7 +21,7 @@ from laces.typing import RenderContext -@servable("renders-fixed-content-template") +@register_servable("renders-fixed-content-template") class RendersTemplateWithFixedContentComponent(Component): template_name = "components/hello-world.html"