3
3
4
4
from aiocache .log import logger
5
5
from aiocache import SimpleMemoryCache , caches
6
- from aiocache .serializers import JsonSerializer
7
6
8
7
9
8
class cached :
@@ -26,7 +25,7 @@ class cached:
26
25
:param cache: cache class to use when calling the ``set``/``get`` operations.
27
26
Default is ``aiocache.SimpleMemoryCache``.
28
27
:param serializer: serializer instance to use when calling the ``dumps``/``loads``.
29
- Default is JsonSerializer .
28
+ If its None, default one from the cache backend is used .
30
29
:param plugins: list plugins to use when calling the cmd hooks
31
30
Default is pulled from the cache class being used.
32
31
:param alias: str specifying the alias to load the config from. If alias is passed, other config
@@ -38,7 +37,7 @@ class cached:
38
37
39
38
def __init__ (
40
39
self , ttl = None , key = None , key_from_attr = None , key_builder = None , cache = SimpleMemoryCache ,
41
- serializer = JsonSerializer , plugins = None , alias = None , noself = False , ** kwargs ):
40
+ serializer = None , plugins = None , alias = None , noself = False , ** kwargs ):
42
41
self .ttl = ttl
43
42
self .key = key
44
43
if key_from_attr is not None :
@@ -202,7 +201,7 @@ class multi_cached:
202
201
:param cache: cache class to use when calling the ``multi_set``/``multi_get`` operations.
203
202
Default is ``aiocache.SimpleMemoryCache``.
204
203
:param serializer: serializer instance to use when calling the ``dumps``/``loads``.
205
- Default is JsonSerializer .
204
+ If its None, default one from the cache backend is used .
206
205
:param plugins: plugins to use when calling the cmd hooks
207
206
Default is pulled from the cache class being used.
208
207
:param alias: str specifying the alias to load the config from. If alias is passed, other config
@@ -211,7 +210,7 @@ class multi_cached:
211
210
212
211
def __init__ (
213
212
self , keys_from_attr , key_builder = None , ttl = 0 , cache = SimpleMemoryCache ,
214
- serializer = JsonSerializer , plugins = None , alias = None , ** kwargs ):
213
+ serializer = None , plugins = None , alias = None , ** kwargs ):
215
214
self .keys_from_attr = keys_from_attr
216
215
self .key_builder = key_builder or (lambda key , * args , ** kwargs : key )
217
216
self .ttl = ttl
0 commit comments