mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 21:46:43 +08:00
move generated stubs to separate directory, too messty
This commit is contained in:
0
django-stubs-generated/views/__init__.pyi
Normal file
0
django-stubs-generated/views/__init__.pyi
Normal file
11
django-stubs-generated/views/csrf.pyi
Normal file
11
django-stubs-generated/views/csrf.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseForbidden
|
||||
|
||||
CSRF_FAILURE_TEMPLATE: str
|
||||
CSRF_FAILURE_TEMPLATE_NAME: str
|
||||
|
||||
def csrf_failure(
|
||||
request: HttpRequest, reason: str = ..., template_name: str = ...
|
||||
) -> HttpResponseForbidden: ...
|
||||
71
django-stubs-generated/views/debug.pyi
Normal file
71
django-stubs-generated/views/debug.pyi
Normal file
@@ -0,0 +1,71 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import QueryDict
|
||||
from django.http.response import Http404, HttpResponse
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
DEBUG_ENGINE: Any
|
||||
HIDDEN_SETTINGS: Any
|
||||
CLEANSED_SUBSTITUTE: str
|
||||
CURRENT_DIR: Any
|
||||
|
||||
class CallableSettingWrapper:
|
||||
def __init__(
|
||||
self, callable_setting: Union[Callable, Type[Any]]
|
||||
) -> None: ...
|
||||
|
||||
def cleanse_setting(key: Union[int, str], value: Any) -> Any: ...
|
||||
def get_safe_settings() -> Dict[str, Any]: ...
|
||||
def technical_500_response(
|
||||
request: Any, exc_type: Any, exc_value: Any, tb: Any, status_code: int = ...
|
||||
): ...
|
||||
def get_default_exception_reporter_filter() -> SafeExceptionReporterFilter: ...
|
||||
def get_exception_reporter_filter(
|
||||
request: Optional[WSGIRequest]
|
||||
) -> SafeExceptionReporterFilter: ...
|
||||
|
||||
class ExceptionReporterFilter:
|
||||
def get_post_parameters(self, request: Any): ...
|
||||
def get_traceback_frame_variables(self, request: Any, tb_frame: Any): ...
|
||||
|
||||
class SafeExceptionReporterFilter(ExceptionReporterFilter):
|
||||
def is_active(self, request: Optional[WSGIRequest]) -> bool: ...
|
||||
def get_cleansed_multivaluedict(
|
||||
self, request: WSGIRequest, multivaluedict: QueryDict
|
||||
) -> QueryDict: ...
|
||||
def get_post_parameters(
|
||||
self, request: Optional[WSGIRequest]
|
||||
) -> Union[Dict[Any, Any], QueryDict]: ...
|
||||
def cleanse_special_types(
|
||||
self, request: Optional[WSGIRequest], value: Any
|
||||
) -> Any: ...
|
||||
def get_traceback_frame_variables(self, request: Any, tb_frame: Any): ...
|
||||
|
||||
class ExceptionReporter:
|
||||
request: Optional[django.core.handlers.wsgi.WSGIRequest] = ...
|
||||
filter: django.views.debug.SafeExceptionReporterFilter = ...
|
||||
exc_type: None = ...
|
||||
exc_value: Optional[str] = ...
|
||||
tb: None = ...
|
||||
is_email: bool = ...
|
||||
template_info: None = ...
|
||||
template_does_not_exist: bool = ...
|
||||
postmortem: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
request: Optional[WSGIRequest],
|
||||
exc_type: None,
|
||||
exc_value: Optional[str],
|
||||
tb: None,
|
||||
is_email: bool = ...,
|
||||
) -> None: ...
|
||||
def get_traceback_data(self) -> Dict[str, Any]: ...
|
||||
def get_traceback_html(self) -> SafeText: ...
|
||||
def get_traceback_text(self) -> SafeText: ...
|
||||
def get_traceback_frames(self) -> List[Any]: ...
|
||||
|
||||
def technical_404_response(
|
||||
request: WSGIRequest, exception: Http404
|
||||
) -> HttpResponse: ...
|
||||
def default_urlconf(request: WSGIRequest) -> HttpResponse: ...
|
||||
11
django-stubs-generated/views/decorators/cache.pyi
Normal file
11
django-stubs-generated/views/decorators/cache.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def cache_page(
|
||||
timeout: float,
|
||||
*,
|
||||
cache: Optional[Any] = ...,
|
||||
key_prefix: Optional[Any] = ...
|
||||
) -> Callable: ...
|
||||
def cache_control(**kwargs: Any) -> Callable: ...
|
||||
def never_cache(view_func: Callable) -> Callable: ...
|
||||
6
django-stubs-generated/views/decorators/clickjacking.pyi
Normal file
6
django-stubs-generated/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: ...
|
||||
23
django-stubs-generated/views/decorators/csrf.pyi
Normal file
23
django-stubs-generated/views/decorators/csrf.pyi
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from django.middleware.csrf import CsrfViewMiddleware
|
||||
|
||||
csrf_protect: Any
|
||||
|
||||
class _EnsureCsrfToken(CsrfViewMiddleware): ...
|
||||
|
||||
requires_csrf_token: Any
|
||||
|
||||
class _EnsureCsrfCookie(CsrfViewMiddleware):
|
||||
get_response: None
|
||||
def process_view(
|
||||
self,
|
||||
request: Any,
|
||||
callback: Any,
|
||||
callback_args: Any,
|
||||
callback_kwargs: Any,
|
||||
): ...
|
||||
|
||||
ensure_csrf_cookie: Any
|
||||
|
||||
def csrf_exempt(view_func: Callable) -> Callable: ...
|
||||
5
django-stubs-generated/views/decorators/debug.pyi
Normal file
5
django-stubs-generated/views/decorators/debug.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def sensitive_variables(*variables: Any) -> Callable: ...
|
||||
def sensitive_post_parameters(*parameters: Any) -> Callable: ...
|
||||
16
django-stubs-generated/views/decorators/http.pyi
Normal file
16
django-stubs-generated/views/decorators/http.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
conditional_page: Any
|
||||
|
||||
def require_http_methods(request_method_list: List[str]) -> Callable: ...
|
||||
|
||||
require_GET: Any
|
||||
require_POST: Any
|
||||
require_safe: Any
|
||||
|
||||
def condition(
|
||||
etag_func: Optional[Callable] = ...,
|
||||
last_modified_func: Optional[Callable] = ...,
|
||||
) -> Callable: ...
|
||||
def etag(etag_func: Callable) -> Callable: ...
|
||||
def last_modified(last_modified_func: Callable) -> Callable: ...
|
||||
5
django-stubs-generated/views/decorators/vary.pyi
Normal file
5
django-stubs-generated/views/decorators/vary.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
|
||||
def vary_on_headers(*headers: Any) -> Callable: ...
|
||||
def vary_on_cookie(func: Callable) -> Callable: ...
|
||||
24
django-stubs-generated/views/defaults.pyi
Normal file
24
django-stubs-generated/views/defaults.pyi
Normal file
@@ -0,0 +1,24 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import (Http404, HttpResponseBadRequest,
|
||||
HttpResponseForbidden, HttpResponseNotFound,
|
||||
HttpResponseServerError)
|
||||
|
||||
ERROR_404_TEMPLATE_NAME: str
|
||||
ERROR_403_TEMPLATE_NAME: str
|
||||
ERROR_400_TEMPLATE_NAME: str
|
||||
ERROR_500_TEMPLATE_NAME: str
|
||||
|
||||
def page_not_found(
|
||||
request: WSGIRequest, exception: Optional[Http404], template_name: str = ...
|
||||
) -> HttpResponseNotFound: ...
|
||||
def server_error(
|
||||
request: WSGIRequest, template_name: str = ...
|
||||
) -> HttpResponseServerError: ...
|
||||
def bad_request(
|
||||
request: WSGIRequest, exception: Exception, template_name: str = ...
|
||||
) -> HttpResponseBadRequest: ...
|
||||
def permission_denied(
|
||||
request: WSGIRequest, exception: Exception, template_name: str = ...
|
||||
) -> HttpResponseForbidden: ...
|
||||
0
django-stubs-generated/views/generic/__init__.pyi
Normal file
0
django-stubs-generated/views/generic/__init__.pyi
Normal file
103
django-stubs-generated/views/generic/base.pyi
Normal file
103
django-stubs-generated/views/generic/base.pyi
Normal file
@@ -0,0 +1,103 @@
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.paginator import Page, Paginator
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import (HttpResponse, HttpResponseNotAllowed,
|
||||
HttpResponseRedirect)
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.generic.list import ListView
|
||||
|
||||
logger: Any
|
||||
|
||||
class ContextMixin:
|
||||
extra_context: Any = ...
|
||||
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: ...
|
||||
|
||||
class View:
|
||||
http_method_names: Any = ...
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
head: Any = ...
|
||||
request: Any = ...
|
||||
args: Any = ...
|
||||
kwargs: Any = ...
|
||||
def as_view(cls, **initkwargs: Any) -> Callable: ...
|
||||
def dispatch(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> Union[HttpResponse, View]: ...
|
||||
def http_method_not_allowed(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseNotAllowed: ...
|
||||
def options(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class TemplateResponseMixin:
|
||||
template_name: Any = ...
|
||||
template_engine: Any = ...
|
||||
response_class: Any = ...
|
||||
content_type: Any = ...
|
||||
def render_to_response(
|
||||
self,
|
||||
context: Union[
|
||||
Dict[str, Any],
|
||||
Dict[str, Optional[Union[List[Dict[str, str]], bool, ListView]]],
|
||||
Dict[
|
||||
str,
|
||||
Union[List[Dict[str, str]], bool, Page, Paginator, ListView],
|
||||
],
|
||||
Dict[
|
||||
str, Union[AuthenticationForm, Site, TemplateResponseMixin, str]
|
||||
],
|
||||
MagicMock,
|
||||
],
|
||||
**response_kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
|
||||
class TemplateView(TemplateResponseMixin, ContextMixin, View):
|
||||
args: Tuple
|
||||
content_type: str
|
||||
extra_context: Dict[str, str]
|
||||
head: Callable
|
||||
kwargs: Dict[str, str]
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
template_engine: str
|
||||
template_name: str
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class RedirectView(View):
|
||||
args: Tuple
|
||||
kwargs: Dict[str, Union[int, str]]
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
permanent: bool = ...
|
||||
url: str = ...
|
||||
pattern_name: str = ...
|
||||
query_string: bool = ...
|
||||
def get_redirect_url(self, *args: Any, **kwargs: Any) -> Optional[str]: ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def head(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def options(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def delete(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def put(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def patch(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
133
django-stubs-generated/views/generic/dates.pyi
Normal file
133
django-stubs-generated/views/generic/dates.pyi
Normal file
@@ -0,0 +1,133 @@
|
||||
from datetime import date
|
||||
from typing import Any, Dict, Optional, Tuple, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic.detail import (BaseDetailView,
|
||||
SingleObjectTemplateResponseMixin)
|
||||
from django.views.generic.list import (MultipleObjectMixin,
|
||||
MultipleObjectTemplateResponseMixin)
|
||||
|
||||
|
||||
class YearMixin:
|
||||
year_format: str = ...
|
||||
year: Any = ...
|
||||
def get_year_format(self) -> str: ...
|
||||
def get_year(self) -> int: ...
|
||||
def get_next_year(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_year(self, date: date) -> Optional[date]: ...
|
||||
|
||||
class MonthMixin:
|
||||
month_format: str = ...
|
||||
month: Any = ...
|
||||
def get_month_format(self) -> str: ...
|
||||
def get_month(self) -> Union[int, str]: ...
|
||||
def get_next_month(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_month(self, date: date) -> Optional[date]: ...
|
||||
|
||||
class DayMixin:
|
||||
day_format: str = ...
|
||||
day: Any = ...
|
||||
def get_day_format(self) -> str: ...
|
||||
def get_day(self) -> Union[int, str]: ...
|
||||
def get_next_day(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_day(self, date: date) -> Optional[date]: ...
|
||||
|
||||
class WeekMixin:
|
||||
week_format: str = ...
|
||||
week: Any = ...
|
||||
def get_week_format(self) -> str: ...
|
||||
def get_week(self) -> int: ...
|
||||
def get_next_week(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_week(self, date: date) -> Optional[date]: ...
|
||||
|
||||
class DateMixin:
|
||||
date_field: Any = ...
|
||||
allow_future: bool = ...
|
||||
def get_date_field(self) -> str: ...
|
||||
def get_allow_future(self) -> bool: ...
|
||||
def uses_datetime_field(self) -> bool: ...
|
||||
|
||||
class BaseDateListView(MultipleObjectMixin, DateMixin, View):
|
||||
allow_empty: bool = ...
|
||||
date_list_period: str = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def get_dated_items(self) -> None: ...
|
||||
def get_ordering(self) -> Union[Tuple[str, str], str]: ...
|
||||
def get_dated_queryset(self, **lookup: Any) -> QuerySet: ...
|
||||
def get_date_list_period(self) -> str: ...
|
||||
def get_date_list(
|
||||
self, queryset: QuerySet, date_type: None = ..., ordering: str = ...
|
||||
) -> QuerySet: ...
|
||||
|
||||
class BaseArchiveIndexView(BaseDateListView):
|
||||
context_object_name: str = ...
|
||||
def get_dated_items(self) -> Tuple[QuerySet, QuerySet, Dict[Any, Any]]: ...
|
||||
|
||||
class ArchiveIndexView(
|
||||
MultipleObjectTemplateResponseMixin, BaseArchiveIndexView
|
||||
):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseYearArchiveView(YearMixin, BaseDateListView):
|
||||
date_list_period: str = ...
|
||||
make_object_list: bool = ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_make_object_list(self) -> bool: ...
|
||||
|
||||
class YearArchiveView(MultipleObjectTemplateResponseMixin, BaseYearArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseMonthArchiveView(YearMixin, MonthMixin, BaseDateListView):
|
||||
date_list_period: str = ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class MonthArchiveView(
|
||||
MultipleObjectTemplateResponseMixin, BaseMonthArchiveView
|
||||
):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseWeekArchiveView(YearMixin, WeekMixin, BaseDateListView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class WeekArchiveView(MultipleObjectTemplateResponseMixin, BaseWeekArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseDayArchiveView(YearMixin, MonthMixin, DayMixin, BaseDateListView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class DayArchiveView(MultipleObjectTemplateResponseMixin, BaseDayArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseTodayArchiveView(BaseDayArchiveView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class TodayArchiveView(
|
||||
MultipleObjectTemplateResponseMixin, BaseTodayArchiveView
|
||||
):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseDateDetailView(
|
||||
YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailView
|
||||
):
|
||||
def get_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
|
||||
class DateDetailView(SingleObjectTemplateResponseMixin, BaseDateDetailView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
def timezone_today() -> date: ...
|
||||
37
django-stubs-generated/views/generic/detail.pyi
Normal file
37
django-stubs-generated/views/generic/detail.pyi
Normal file
@@ -0,0 +1,37 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
|
||||
|
||||
|
||||
class SingleObjectMixin(ContextMixin):
|
||||
model: Any = ...
|
||||
queryset: Any = ...
|
||||
slug_field: str = ...
|
||||
context_object_name: Any = ...
|
||||
slug_url_kwarg: str = ...
|
||||
pk_url_kwarg: str = ...
|
||||
query_pk_and_slug: bool = ...
|
||||
def get_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def get_slug_field(self) -> str: ...
|
||||
def get_context_object_name(
|
||||
self, obj: Union[Dict[str, str], Model]
|
||||
) -> Optional[str]: ...
|
||||
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: ...
|
||||
|
||||
class BaseDetailView(SingleObjectMixin, View):
|
||||
object: Any = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class SingleObjectTemplateResponseMixin(TemplateResponseMixin):
|
||||
template_name_field: Any = ...
|
||||
template_name_suffix: str = ...
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
|
||||
class DetailView(SingleObjectTemplateResponseMixin, BaseDetailView): ...
|
||||
96
django-stubs-generated/views/generic/edit.pyi
Normal file
96
django-stubs-generated/views/generic/edit.pyi
Normal file
@@ -0,0 +1,96 @@
|
||||
from typing import Any, Dict, Optional, Type, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.db.models.base import Model
|
||||
from django.forms.forms import BaseForm, Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponse, HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
|
||||
from django.views.generic.detail import (BaseDetailView, SingleObjectMixin,
|
||||
SingleObjectTemplateResponseMixin)
|
||||
|
||||
|
||||
class FormMixin(ContextMixin):
|
||||
initial: Any = ...
|
||||
form_class: Any = ...
|
||||
success_url: Any = ...
|
||||
prefix: Any = ...
|
||||
def get_initial(self) -> Dict[Any, Any]: ...
|
||||
def get_prefix(self) -> None: ...
|
||||
def get_form_class(self) -> Type[Form]: ...
|
||||
def get_form(self, form_class: None = ...) -> BaseForm: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[Dict[str, str], MultiValueDict]]]: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
def form_valid(self, form: BaseForm) -> HttpResponseRedirect: ...
|
||||
def form_invalid(self, form: Form) -> TemplateResponse: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
) -> Dict[str, Union[Model, BaseForm, TemplateResponseMixin]]: ...
|
||||
|
||||
class ModelFormMixin(FormMixin, SingleObjectMixin):
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
fields: Any = ...
|
||||
def get_form_class(self) -> Type[ModelForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Optional[Union[Dict[Any, Any], Model, MultiValueDict]]]: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
object: Any = ...
|
||||
def form_valid(self, form: ModelForm) -> HttpResponseRedirect: ...
|
||||
|
||||
class ProcessFormView(View):
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def post(
|
||||
self, request: HttpRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def put(self, *args: Any, **kwargs: Any): ...
|
||||
|
||||
class BaseFormView(FormMixin, ProcessFormView): ...
|
||||
class FormView(TemplateResponseMixin, BaseFormView): ...
|
||||
|
||||
class BaseCreateView(ModelFormMixin, ProcessFormView):
|
||||
object: Any = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class CreateView(SingleObjectTemplateResponseMixin, BaseCreateView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseUpdateView(ModelFormMixin, ProcessFormView):
|
||||
object: Any = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class UpdateView(SingleObjectTemplateResponseMixin, BaseUpdateView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class DeletionMixin:
|
||||
success_url: Any = ...
|
||||
object: Any = ...
|
||||
def delete(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def post(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponseRedirect: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
|
||||
class BaseDeleteView(DeletionMixin, BaseDetailView): ...
|
||||
|
||||
class DeleteView(SingleObjectTemplateResponseMixin, BaseDeleteView):
|
||||
template_name_suffix: str = ...
|
||||
57
django-stubs-generated/views/generic/list.pyi
Normal file
57
django-stubs-generated/views/generic/list.pyi
Normal file
@@ -0,0 +1,57 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.core.paginator import Page, Paginator
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
|
||||
|
||||
|
||||
class MultipleObjectMixin(ContextMixin):
|
||||
allow_empty: bool = ...
|
||||
queryset: Any = ...
|
||||
model: Any = ...
|
||||
paginate_by: Any = ...
|
||||
paginate_orphans: int = ...
|
||||
context_object_name: Any = ...
|
||||
paginator_class: Any = ...
|
||||
page_kwarg: str = ...
|
||||
ordering: Any = ...
|
||||
def get_queryset(self) -> Union[List[Dict[str, str]], QuerySet]: ...
|
||||
def get_ordering(self) -> Optional[Union[Tuple[str, str], str]]: ...
|
||||
def paginate_queryset(
|
||||
self, queryset: Union[List[Dict[str, str]], QuerySet], page_size: int
|
||||
) -> Tuple[
|
||||
Paginator, Page, Union[List[Dict[str, str]], QuerySet], bool
|
||||
]: ...
|
||||
def get_paginate_by(
|
||||
self, queryset: Optional[Union[List[Dict[str, str]], QuerySet]]
|
||||
) -> Optional[int]: ...
|
||||
def get_paginator(
|
||||
self,
|
||||
queryset: Union[List[Dict[str, str]], QuerySet],
|
||||
per_page: int,
|
||||
orphans: int = ...,
|
||||
allow_empty_first_page: bool = ...,
|
||||
**kwargs: Any
|
||||
) -> Paginator: ...
|
||||
def get_paginate_orphans(self) -> int: ...
|
||||
def get_allow_empty(self) -> bool: ...
|
||||
def get_context_object_name(
|
||||
self, object_list: Optional[Union[List[Dict[str, str]], QuerySet]]
|
||||
) -> Optional[str]: ...
|
||||
def get_context_data(
|
||||
self, *, object_list: Optional[Any] = ..., **kwargs: Any
|
||||
) -> Dict[str, Any]: ...
|
||||
|
||||
class BaseListView(MultipleObjectMixin, View):
|
||||
object_list: Any = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
class MultipleObjectTemplateResponseMixin(TemplateResponseMixin):
|
||||
template_name_suffix: str = ...
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
|
||||
class ListView(MultipleObjectTemplateResponseMixin, BaseListView): ...
|
||||
45
django-stubs-generated/views/i18n.pyi
Normal file
45
django-stubs-generated/views/i18n.pyi
Normal file
@@ -0,0 +1,45 @@
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import HttpResponse
|
||||
from django.views.generic import View
|
||||
|
||||
LANGUAGE_QUERY_PARAMETER: str
|
||||
|
||||
def set_language(request: WSGIRequest) -> HttpResponse: ...
|
||||
def get_formats() -> Dict[str, Union[List[str], int, str]]: ...
|
||||
|
||||
js_catalog_template: str
|
||||
|
||||
def render_javascript_catalog(
|
||||
catalog: Optional[Any] = ..., plural: Optional[Any] = ...
|
||||
): ...
|
||||
def null_javascript_catalog(
|
||||
request: Any, domain: Optional[Any] = ..., packages: Optional[Any] = ...
|
||||
): ...
|
||||
|
||||
class JavaScriptCatalog(View):
|
||||
args: Tuple
|
||||
head: Callable
|
||||
kwargs: Dict[Any, Any]
|
||||
request: django.core.handlers.wsgi.WSGIRequest
|
||||
domain: str = ...
|
||||
packages: List[str] = ...
|
||||
translation: django.utils.translation.trans_real.DjangoTranslation = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
def get_paths(self, packages: List[str]) -> List[str]: ...
|
||||
def get_plural(self) -> None: ...
|
||||
def get_catalog(self) -> Dict[str, Union[List[str], str]]: ...
|
||||
def get_context_data(
|
||||
self, **kwargs: Any
|
||||
) -> Dict[str, Optional[Dict[str, Union[List[str], int, str]]]]: ...
|
||||
def render_to_response(
|
||||
self,
|
||||
context: Dict[str, Optional[Dict[str, Union[List[str], int, str]]]],
|
||||
**response_kwargs: Any
|
||||
) -> HttpResponse: ...
|
||||
|
||||
class JSONCatalog(JavaScriptCatalog):
|
||||
def render_to_response(self, context: Any, **response_kwargs: Any): ...
|
||||
20
django-stubs-generated/views/static.pyi
Normal file
20
django-stubs-generated/views/static.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import FileResponse
|
||||
|
||||
|
||||
def serve(
|
||||
request: WSGIRequest,
|
||||
path: str,
|
||||
document_root: str = ...,
|
||||
show_indexes: bool = ...,
|
||||
) -> FileResponse: ...
|
||||
|
||||
DEFAULT_DIRECTORY_INDEX_TEMPLATE: str
|
||||
template_translatable: Any
|
||||
|
||||
def directory_index(path: Any, fullpath: Any): ...
|
||||
def was_modified_since(
|
||||
header: None = ..., mtime: float = ..., size: int = ...
|
||||
) -> bool: ...
|
||||
Reference in New Issue
Block a user