mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 20:24:31 +08:00
Add 'django.core.cache.backends.memcached' stubs (#141)
This commit is contained in:
24
django-stubs/core/cache/backends/locmem.pyi
vendored
24
django-stubs/core/cache/backends/locmem.pyi
vendored
@@ -1,26 +1,6 @@
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
from typing import Any, Dict
|
||||
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
|
||||
class LocMemCache(BaseCache):
|
||||
default_timeout: int
|
||||
key_func: Callable
|
||||
key_prefix: str
|
||||
version: int
|
||||
def __init__(self, name: str, params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]]) -> None: ...
|
||||
def add(
|
||||
self,
|
||||
key: str,
|
||||
value: Union[Dict[str, int], Dict[str, str], bytes, int, str],
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Any: ...
|
||||
def get(
|
||||
self, key: Union[int, str], default: Optional[Union[int, str]] = ..., version: Optional[int] = ...
|
||||
) -> Any: ...
|
||||
def set(self, key: Union[int, str], value: Any, timeout: Any = ..., version: Optional[int] = ...) -> None: ...
|
||||
def touch(self, key: str, timeout: Any = ..., version: None = ...) -> Any: ...
|
||||
def incr(self, key: Union[int, str], delta: int = ..., version: Optional[int] = ...) -> int: ...
|
||||
def has_key(self, key: str, version: Optional[int] = ...) -> Any: ...
|
||||
def delete(self, key: str, version: Optional[int] = ...) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def __init__(self, name: str, params: Dict[str, Any]) -> None: ...
|
||||
|
||||
10
django-stubs/core/cache/backends/memcached.pyi
vendored
Normal file
10
django-stubs/core/cache/backends/memcached.pyi
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
|
||||
class BaseMemcachedCache(BaseCache):
|
||||
def __init__(self, server, params, library, value_not_found_exception) -> None: ...
|
||||
|
||||
class MemcachedCache(BaseMemcachedCache):
|
||||
def __init__(self, server, params): ...
|
||||
|
||||
class PyLibMCCache(BaseMemcachedCache):
|
||||
def __init__(self, server, params): ...
|
||||
Reference in New Issue
Block a user