mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 18:05:58 +08:00
improved version
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user