1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
from typing import Any
from django.utils.connection import BaseConnectionHandler
from .backends.base import BaseCache as BaseCache
from .backends.base import CacheKeyWarning as CacheKeyWarning
from .backends.base import InvalidCacheBackendError as InvalidCacheBackendError
from .backends.base import InvalidCacheKey as InvalidCacheKey
DEFAULT_CACHE_ALIAS: str
class CacheHandler(BaseConnectionHandler[BaseCache]):
settings_name: str
exception_class: type[Exception]
def create_connection(self, alias: str) -> BaseCache: ...
def all(self, initialized_only: bool = False) -> list[BaseCache]: ...
def close_caches(**kwargs: Any) -> None: ...
caches: CacheHandler
# Actually ConnectionProxy, but quacks exactly like BaseCache, it's not worth distinguishing the two.
cache: BaseCache
__all__ = [
"DEFAULT_CACHE_ALIAS",
"BaseCache",
"CacheKeyWarning",
"InvalidCacheBackendError",
"InvalidCacheKey",
"cache",
"caches",
]
|