mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-20 02:41:16 +08:00
better stubs
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
# Stubs for django.views.decorators.cache (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def cache_page(
|
||||
timeout: float, *, cache: Optional[Any] = ..., key_prefix: Optional[Any] = ...
|
||||
timeout: float,
|
||||
*,
|
||||
cache: Optional[Any] = ...,
|
||||
key_prefix: Optional[Any] = ...
|
||||
) -> Callable: ...
|
||||
def cache_control(**kwargs: Any): ...
|
||||
def cache_control(**kwargs: Any) -> Callable: ...
|
||||
def never_cache(view_func: Callable) -> Callable: ...
|
||||
|
||||
6
django-stubs/views/decorators/clickjacking.pyi
Normal file
6
django-stubs/views/decorators/clickjacking.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def xframe_options_deny(view_func: Callable) -> Callable: ...
|
||||
def xframe_options_sameorigin(view_func: Callable) -> Callable: ...
|
||||
def xframe_options_exempt(view_func: Callable) -> Callable: ...
|
||||
@@ -1,30 +1,22 @@
|
||||
# Stubs for django.views.decorators.csrf (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.middleware.csrf import CsrfViewMiddleware
|
||||
from typing import Any
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from typing import Any, Callable, Dict, Tuple
|
||||
|
||||
csrf_protect: Any
|
||||
|
||||
class _EnsureCsrfToken(CsrfViewMiddleware):
|
||||
def _reject(self, request: HttpRequest, reason: str) -> None: ...
|
||||
class _EnsureCsrfToken(CsrfViewMiddleware): ...
|
||||
|
||||
requires_csrf_token: Any
|
||||
|
||||
class _EnsureCsrfCookie(CsrfViewMiddleware):
|
||||
def _reject(self, request: HttpRequest, reason: str) -> None: ...
|
||||
def process_view(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
callback: Callable,
|
||||
callback_args: Tuple,
|
||||
callback_kwargs: Dict[Any, Any],
|
||||
) -> None: ...
|
||||
request: Any,
|
||||
callback: Any,
|
||||
callback_args: Any,
|
||||
callback_kwargs: Any,
|
||||
): ...
|
||||
|
||||
ensure_csrf_cookie: Any
|
||||
|
||||
def csrf_exempt(view_func: Callable) -> Callable: ...
|
||||
def csrf_exempt(view_func: Any): ...
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
# Stubs for django.views.decorators.debug (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def sensitive_variables(*variables: Any) -> Callable: ...
|
||||
def sensitive_post_parameters(*parameters: Any) -> Callable: ...
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
# Stubs for django.views.decorators.http (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any, Optional
|
||||
|
||||
from typing import Callable, List
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
conditional_page: Any
|
||||
|
||||
@@ -14,6 +8,9 @@ require_GET: Any
|
||||
require_POST: Any
|
||||
require_safe: Any
|
||||
|
||||
def condition(etag_func: Callable = ..., last_modified_func: None = ...) -> Callable: ...
|
||||
def condition(
|
||||
etag_func: Optional[Callable] = ...,
|
||||
last_modified_func: Optional[Callable] = ...,
|
||||
) -> Callable: ...
|
||||
def etag(etag_func: Callable) -> Callable: ...
|
||||
def last_modified(last_modified_func: Any): ...
|
||||
def last_modified(last_modified_func: Callable) -> Callable: ...
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
# Stubs for django.views.decorators.vary (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from typing import Any
|
||||
|
||||
from typing import Callable
|
||||
|
||||
def vary_on_headers(*headers: Any) -> Callable: ...
|
||||
def vary_on_cookie(func: Callable) -> Callable: ...
|
||||
|
||||
Reference in New Issue
Block a user