mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-23 12:21:28 +08:00
third iteration of stubs
This commit is contained in:
@@ -6,12 +6,12 @@ from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
|
||||
class UpdateCacheMiddleware(MiddlewareMixin):
|
||||
cache_timeout: float = ...
|
||||
cache_timeout: Union[float, int] = ...
|
||||
key_prefix: str = ...
|
||||
cache_alias: str = ...
|
||||
cache: Union[
|
||||
django.core.cache.backends.base.BaseCache,
|
||||
django.core.cache.DefaultCacheProxy,
|
||||
django.core.cache.backends.base.BaseCache,
|
||||
] = ...
|
||||
get_response: Optional[Callable] = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
@@ -23,8 +23,8 @@ class FetchFromCacheMiddleware(MiddlewareMixin):
|
||||
key_prefix: str = ...
|
||||
cache_alias: str = ...
|
||||
cache: Union[
|
||||
django.core.cache.backends.base.BaseCache,
|
||||
django.core.cache.DefaultCacheProxy,
|
||||
django.core.cache.backends.base.BaseCache,
|
||||
] = ...
|
||||
get_response: Optional[Callable] = ...
|
||||
def __init__(self, get_response: Optional[Callable] = ...) -> None: ...
|
||||
@@ -36,11 +36,11 @@ class CacheMiddleware(UpdateCacheMiddleware, FetchFromCacheMiddleware):
|
||||
get_response: None = ...
|
||||
key_prefix: str = ...
|
||||
cache_alias: str = ...
|
||||
cache_timeout: float = ...
|
||||
cache_timeout: Union[float, int] = ...
|
||||
cache: django.core.cache.backends.locmem.LocMemCache = ...
|
||||
def __init__(
|
||||
self,
|
||||
get_response: None = ...,
|
||||
cache_timeout: Optional[float] = ...,
|
||||
cache_timeout: Optional[Union[float, int]] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union
|
||||
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from django.core.exceptions import PermissionDenied, SuspiciousOperation
|
||||
from django.http.multipartparser import MultiPartParserError
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseBase, HttpResponseForbidden
|
||||
from django.http.response import (Http404, HttpResponseBase,
|
||||
HttpResponseForbidden)
|
||||
from django.utils.deprecation import MiddlewareMixin
|
||||
|
||||
logger: Any
|
||||
@@ -27,7 +31,17 @@ class CsrfViewMiddleware(MiddlewareMixin):
|
||||
request: HttpRequest,
|
||||
callback: Callable,
|
||||
callback_args: Tuple,
|
||||
callback_kwargs: Dict[str, Any],
|
||||
callback_kwargs: Union[
|
||||
Dict[str, Dict[str, Sitemap]],
|
||||
Dict[str, Dict[str, str]],
|
||||
Dict[str, None],
|
||||
Dict[str, Union[Dict[str, Type[Sitemap]], str]],
|
||||
Dict[str, Union[int, str]],
|
||||
Dict[str, PermissionDenied],
|
||||
Dict[str, SuspiciousOperation],
|
||||
Dict[str, MultiPartParserError],
|
||||
Dict[str, Http404],
|
||||
],
|
||||
) -> Optional[HttpResponseForbidden]: ...
|
||||
def process_response(
|
||||
self, request: HttpRequest, response: HttpResponseBase
|
||||
|
||||
Reference in New Issue
Block a user