mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-16 08:47:49 +08:00
improved version
This commit is contained in:
@@ -59,7 +59,7 @@ class ExceptionReporter:
|
||||
context_lines: int,
|
||||
loader: Optional[Union[SourceFileLoader, Type[FrozenImporter]]] = ...,
|
||||
module_name: str = ...
|
||||
) -> Union[Tuple[int, List[str], str, List[str]], Tuple[None, List[Any], None, List[Any]], Tuple[int, List[str], str, List[Any]]]: ...
|
||||
) -> Union[Tuple[int, List[str], str, List[Any]], Tuple[int, List[str], str, List[str]], Tuple[None, List[Any], None, List[Any]]]: ...
|
||||
def get_traceback_data(self) -> Dict[str, Any]: ...
|
||||
def get_traceback_frames(self) -> List[Any]: ...
|
||||
def get_traceback_html(self) -> SafeText: ...
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
from typing import (
|
||||
Callable,
|
||||
Union,
|
||||
)
|
||||
from typing import Callable
|
||||
|
||||
|
||||
def cache_page(timeout: Union[float, int], *, cache = ..., key_prefix = ...) -> Callable: ...
|
||||
def cache_page(timeout: float, *, cache = ..., key_prefix = ...) -> Callable: ...
|
||||
|
||||
|
||||
def never_cache(view_func: Callable) -> Callable: ...
|
||||
@@ -1,4 +1,3 @@
|
||||
from csrf_tests.tests import TestingHttpRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Any,
|
||||
@@ -12,10 +11,10 @@ def csrf_exempt(view_func: Callable) -> Callable: ...
|
||||
|
||||
|
||||
class _EnsureCsrfCookie:
|
||||
def _reject(self, request: TestingHttpRequest, reason: str) -> None: ...
|
||||
def _reject(self, request: HttpRequest, reason: str) -> None: ...
|
||||
def process_view(
|
||||
self,
|
||||
request: TestingHttpRequest,
|
||||
request: HttpRequest,
|
||||
callback: Callable,
|
||||
callback_args: Tuple,
|
||||
callback_kwargs: Dict[Any, Any]
|
||||
|
||||
@@ -16,7 +16,7 @@ from typing import (
|
||||
|
||||
|
||||
class ContextMixin:
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, object]: ...
|
||||
|
||||
|
||||
class RedirectView:
|
||||
|
||||
@@ -65,10 +65,10 @@ class BaseDayArchiveView:
|
||||
def _get_dated_items(
|
||||
self,
|
||||
date: date
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, Union[date, None]]], Tuple[None, QuerySet, Dict[str, date]]]: ...
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, date]], Tuple[None, QuerySet, Dict[str, Union[date, None]]]]: ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, Union[date, None]]], Tuple[None, QuerySet, Dict[str, date]]]: ...
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, date]], Tuple[None, QuerySet, Dict[str, Union[date, None]]]]: ...
|
||||
|
||||
|
||||
class BaseMonthArchiveView:
|
||||
|
||||
@@ -3,7 +3,6 @@ from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
@@ -21,8 +20,8 @@ class BaseDetailView:
|
||||
|
||||
|
||||
class SingleObjectMixin:
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
def get_context_object_name(self, obj: Union[Model, Dict[str, str]]) -> Optional[str]: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, object]: ...
|
||||
def get_context_object_name(self, obj: Union[Dict[str, str], Model]) -> Optional[str]: ...
|
||||
def get_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def get_slug_field(self) -> str: ...
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.forms.forms import (
|
||||
BaseForm,
|
||||
Form,
|
||||
)
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.http.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
@@ -55,9 +52,9 @@ class FormMixin:
|
||||
def form_invalid(self, form: Form) -> TemplateResponse: ...
|
||||
def form_valid(self, form: Form) -> HttpResponseRedirect: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
def get_form(self, form_class: None = ...) -> BaseForm: ...
|
||||
def get_form_class(self) -> Any: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Union[None, MultiValueDict]]: ...
|
||||
def get_form(self, form_class: None = ...) -> Union[Form, ModelForm]: ...
|
||||
def get_form_class(self) -> Type[Form]: ...
|
||||
def get_form_kwargs(self) -> Dict[str, Optional[MultiValueDict]]: ...
|
||||
def get_initial(self) -> Dict[Any, Any]: ...
|
||||
def get_prefix(self) -> None: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
@@ -67,7 +64,7 @@ class ModelFormMixin:
|
||||
def get_form_class(self) -> Type[ModelForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Union[None, MultiValueDict, Model]]: ...
|
||||
) -> Dict[str, Optional[Union[MultiValueDict, Model]]]: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ class MultipleObjectMixin:
|
||||
def get_context_data(self, *, object_list = ..., **kwargs) -> Dict[str, Any]: ...
|
||||
def get_context_object_name(
|
||||
self,
|
||||
object_list: Optional[Union[QuerySet, List[Dict[str, str]]]]
|
||||
object_list: Optional[Union[List[Dict[str, str]], QuerySet]]
|
||||
) -> Optional[str]: ...
|
||||
def get_ordering(self) -> None: ...
|
||||
def get_paginate_by(self, queryset: Union[QuerySet, List[Dict[str, str]]]) -> Optional[int]: ...
|
||||
def get_paginate_by(self, queryset: Union[List[Dict[str, str]], QuerySet]) -> Optional[int]: ...
|
||||
def get_paginate_orphans(self) -> int: ...
|
||||
def get_paginator(
|
||||
self,
|
||||
@@ -42,7 +42,7 @@ class MultipleObjectMixin:
|
||||
allow_empty_first_page: bool = ...,
|
||||
**kwargs
|
||||
) -> Paginator: ...
|
||||
def get_queryset(self) -> Union[QuerySet, List[Dict[str, str]]]: ...
|
||||
def get_queryset(self) -> Union[List[Dict[str, str]], QuerySet]: ...
|
||||
def paginate_queryset(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
|
||||
@@ -39,6 +39,6 @@ class JavaScriptCatalog:
|
||||
def get_plural(self) -> Optional[str]: ...
|
||||
def render_to_response(
|
||||
self,
|
||||
context: Dict[str, Union[Dict[str, Union[str, int, List[str]]], None, Dict[str, str], Dict[str, Union[str, List[str]]]]],
|
||||
context: Dict[str, Optional[Union[Dict[str, str], Dict[str, Union[str, int, List[str]]], Dict[str, Union[str, List[str]]]]]],
|
||||
**response_kwargs
|
||||
) -> HttpResponse: ...
|
||||
Reference in New Issue
Block a user