Coverage for src/lexigram/admin/settings/panel/cache_spec.py: 100%
14 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-21 14:56 +0800
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-21 14:56 +0800
1"""Cache configuration specification."""
3from __future__ import annotations
5from lexigram.admin.settings.panel.models import CacheSettings
6from lexigram.admin.settings.panel.nodes import PydanticConfigSpec
7from lexigram.admin.settings.panel.registry import ConfigRegistry
9__all__ = ["CacheSpec", "register_spec"]
12class CacheSpec(PydanticConfigSpec):
13 """Cache configuration spec."""
15 namespace = "admin.cache"
16 label = "Response Caching"
17 icon = "cube-transparent"
18 description = "Toggle response caching and set the default TTL."
19 model = CacheSettings
20 required_permissions = frozenset({"admin.settings.edit"})
23def register_spec(registry: ConfigRegistry) -> None:
24 """Register this spec with the config registry."""
25 registry.register_spec(CacheSpec)