mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-20 02:41:16 +08:00
fifth iteration
This commit is contained in:
3
django-stubs/core/cache/__init__.pyi
vendored
3
django-stubs/core/cache/__init__.pyi
vendored
@@ -1,3 +1,4 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
|
||||
from django.core.cache.backends.base import BaseCache as BaseCache
|
||||
@@ -15,7 +16,7 @@ class CacheHandler:
|
||||
class DefaultCacheProxy:
|
||||
def __getattr__(
|
||||
self, name: str
|
||||
) -> Union[Callable, Dict[str, float], int]: ...
|
||||
) -> Union[Callable, Dict[str, float], OrderedDict, int]: ...
|
||||
def __setattr__(self, name: str, value: Callable) -> None: ...
|
||||
def __delattr__(self, name: Any): ...
|
||||
def __contains__(self, key: str) -> bool: ...
|
||||
|
||||
15
django-stubs/core/cache/backends/base.pyi
vendored
15
django-stubs/core/cache/backends/base.pyi
vendored
@@ -1,3 +1,4 @@
|
||||
from collections import OrderedDict
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
@@ -21,13 +22,7 @@ class BaseCache:
|
||||
key_func: Callable = ...
|
||||
def __init__(
|
||||
self,
|
||||
params: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, Dict[str, int]],
|
||||
Dict[str, None],
|
||||
Dict[str, int],
|
||||
Dict[str, str],
|
||||
],
|
||||
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
|
||||
) -> None: ...
|
||||
def get_backend_timeout(self, timeout: Any = ...) -> Optional[float]: ...
|
||||
def make_key(
|
||||
@@ -59,7 +54,7 @@ class BaseCache:
|
||||
def delete(self, key: Any, version: Optional[Any] = ...) -> None: ...
|
||||
def get_many(
|
||||
self, keys: List[str], version: Optional[int] = ...
|
||||
) -> Union[Dict[str, int], Dict[str, str]]: ...
|
||||
) -> Dict[str, Union[int, str]]: ...
|
||||
def get_or_set(
|
||||
self,
|
||||
key: str,
|
||||
@@ -78,9 +73,7 @@ class BaseCache:
|
||||
def set_many(
|
||||
self,
|
||||
data: Union[
|
||||
Dict[str, Union[Dict[str, int], str]],
|
||||
Dict[str, bytes],
|
||||
Dict[str, int],
|
||||
Dict[str, bytes], Dict[str, int], Dict[str, str], OrderedDict
|
||||
],
|
||||
timeout: Any = ...,
|
||||
version: Optional[Union[int, str]] = ...,
|
||||
|
||||
7
django-stubs/core/cache/backends/db.pyi
vendored
7
django-stubs/core/cache/backends/db.pyi
vendored
@@ -25,12 +25,7 @@ class BaseDatabaseCache(BaseCache):
|
||||
def __init__(
|
||||
self,
|
||||
table: str,
|
||||
params: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, Dict[str, int]],
|
||||
Dict[str, int],
|
||||
Dict[str, str],
|
||||
],
|
||||
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
|
||||
) -> None: ...
|
||||
|
||||
class DatabaseCache(BaseDatabaseCache):
|
||||
|
||||
@@ -12,12 +12,7 @@ class FileBasedCache(BaseCache):
|
||||
def __init__(
|
||||
self,
|
||||
dir: str,
|
||||
params: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, Dict[str, int]],
|
||||
Dict[str, int],
|
||||
Dict[str, str],
|
||||
],
|
||||
params: Dict[str, Union[Callable, Dict[str, int], int, str]],
|
||||
) -> None: ...
|
||||
def add(
|
||||
self,
|
||||
|
||||
13
django-stubs/core/cache/backends/locmem.pyi
vendored
13
django-stubs/core/cache/backends/locmem.pyi
vendored
@@ -1,4 +1,3 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, Optional, Union
|
||||
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
@@ -12,20 +11,12 @@ class LocMemCache(BaseCache):
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
params: Union[
|
||||
Dict[str, Callable],
|
||||
Dict[str, Dict[str, int]],
|
||||
Dict[str, None],
|
||||
Dict[str, int],
|
||||
Dict[str, str],
|
||||
],
|
||||
params: Dict[str, Optional[Union[Callable, Dict[str, int], int, str]]],
|
||||
) -> None: ...
|
||||
def add(
|
||||
self,
|
||||
key: str,
|
||||
value: Union[
|
||||
Dict[str, Union[datetime, str]], Dict[str, int], bytes, int, str
|
||||
],
|
||||
value: Union[Dict[str, int], Dict[str, str], bytes, int, str],
|
||||
timeout: Any = ...,
|
||||
version: Optional[int] = ...,
|
||||
) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user