mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
get_cache_key can have multiple httprequest types. (#852)
* Update cache.pyi * Apply black
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from typing import Any, Optional, Tuple
|
||||
from typing import Any, Optional, Tuple, Union
|
||||
|
||||
from django.core.cache.backends.base import BaseCache
|
||||
from django.core.handlers.asgi import ASGIRequest
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http import HttpRequest
|
||||
from django.http.response import HttpResponse, HttpResponseBase
|
||||
|
||||
cc_delim_re: Any
|
||||
@@ -20,7 +22,10 @@ def add_never_cache_headers(response: HttpResponseBase) -> None: ...
|
||||
def patch_vary_headers(response: HttpResponseBase, newheaders: Tuple[str]) -> None: ...
|
||||
def has_vary_header(response: HttpResponse, header_query: str) -> bool: ...
|
||||
def get_cache_key(
|
||||
request: WSGIRequest, key_prefix: Optional[str] = ..., method: str = ..., cache: Optional[BaseCache] = ...
|
||||
request: Union[ASGIRequest, HttpRequest, WSGIRequest],
|
||||
key_prefix: Optional[str] = ...,
|
||||
method: str = ...,
|
||||
cache: Optional[BaseCache] = ...,
|
||||
) -> Optional[str]: ...
|
||||
def learn_cache_key(
|
||||
request: WSGIRequest,
|
||||
|
||||
Reference in New Issue
Block a user