summaryrefslogtreecommitdiff
path: root/django/core/cache/__init__.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /django/core/cache/__init__.py
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'django/core/cache/__init__.py')
-rw-r--r--django/core/cache/__init__.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py
index a311b50af6..f09c9ecc4b 100644
--- a/django/core/cache/__init__.py
+++ b/django/core/cache/__init__.py
@@ -14,27 +14,35 @@ See docs/topics/cache.txt for information on the public API.
"""
from django.core import signals
from django.core.cache.backends.base import (
- BaseCache, CacheKeyWarning, InvalidCacheBackendError, InvalidCacheKey,
+ BaseCache,
+ CacheKeyWarning,
+ InvalidCacheBackendError,
+ InvalidCacheKey,
)
from django.utils.connection import BaseConnectionHandler, ConnectionProxy
from django.utils.module_loading import import_string
__all__ = [
- 'cache', 'caches', 'DEFAULT_CACHE_ALIAS', 'InvalidCacheBackendError',
- 'CacheKeyWarning', 'BaseCache', 'InvalidCacheKey',
+ "cache",
+ "caches",
+ "DEFAULT_CACHE_ALIAS",
+ "InvalidCacheBackendError",
+ "CacheKeyWarning",
+ "BaseCache",
+ "InvalidCacheKey",
]
-DEFAULT_CACHE_ALIAS = 'default'
+DEFAULT_CACHE_ALIAS = "default"
class CacheHandler(BaseConnectionHandler):
- settings_name = 'CACHES'
+ settings_name = "CACHES"
exception_class = InvalidCacheBackendError
def create_connection(self, alias):
params = self.settings[alias].copy()
- backend = params.pop('BACKEND')
- location = params.pop('LOCATION', '')
+ backend = params.pop("BACKEND")
+ location = params.pop("LOCATION", "")
try:
backend_cls = import_string(backend)
except ImportError as e:
@@ -45,7 +53,8 @@ class CacheHandler(BaseConnectionHandler):
def all(self, initialized_only=False):
return [
- self[alias] for alias in self
+ self[alias]
+ for alias in self
# If initialized_only is True, return only initialized caches.
if not initialized_only or hasattr(self._connections, alias)
]