mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
first version finished
This commit is contained in:
9
django/views/csrf.pyi
Normal file
9
django/views/csrf.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.http.request import HttpRequest
|
||||
from django.http.response import HttpResponseForbidden
|
||||
|
||||
|
||||
def csrf_failure(
|
||||
request: HttpRequest,
|
||||
reason: str = ...,
|
||||
template_name: str = ...
|
||||
) -> HttpResponseForbidden: ...
|
||||
80
django/views/debug.pyi
Normal file
80
django/views/debug.pyi
Normal file
@@ -0,0 +1,80 @@
|
||||
from _frozen_importlib import FrozenImporter
|
||||
from _frozen_importlib_external import SourceFileLoader
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.request import QueryDict
|
||||
from django.http.response import (
|
||||
Http404,
|
||||
HttpResponseNotFound,
|
||||
)
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def cleanse_setting(key: Union[str, int], value: Any) -> Any: ...
|
||||
|
||||
|
||||
def get_default_exception_reporter_filter() -> SafeExceptionReporterFilter: ...
|
||||
|
||||
|
||||
def get_exception_reporter_filter(
|
||||
request: Optional[WSGIRequest]
|
||||
) -> SafeExceptionReporterFilter: ...
|
||||
|
||||
|
||||
def get_safe_settings() -> Dict[str, Any]: ...
|
||||
|
||||
|
||||
def technical_404_response(
|
||||
request: WSGIRequest,
|
||||
exception: Http404
|
||||
) -> HttpResponseNotFound: ...
|
||||
|
||||
|
||||
class CallableSettingWrapper:
|
||||
def __init__(self, callable_setting: Type[object]) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
|
||||
class ExceptionReporter:
|
||||
def __init__(
|
||||
self,
|
||||
request: Optional[WSGIRequest],
|
||||
exc_type: None,
|
||||
exc_value: Optional[str],
|
||||
tb: None,
|
||||
is_email: bool = ...
|
||||
) -> None: ...
|
||||
def _get_lines_from_file(
|
||||
self,
|
||||
filename: str,
|
||||
lineno: int,
|
||||
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]]]: ...
|
||||
def get_traceback_data(self) -> Dict[str, Any]: ...
|
||||
def get_traceback_frames(self) -> List[Any]: ...
|
||||
def get_traceback_html(self) -> SafeText: ...
|
||||
def get_traceback_text(self) -> SafeText: ...
|
||||
|
||||
|
||||
class SafeExceptionReporterFilter:
|
||||
def cleanse_special_types(self, request: Optional[WSGIRequest], value: Any) -> Any: ...
|
||||
def get_cleansed_multivaluedict(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
multivaluedict: QueryDict
|
||||
) -> QueryDict: ...
|
||||
def get_post_parameters(
|
||||
self,
|
||||
request: Optional[WSGIRequest]
|
||||
) -> QueryDict: ...
|
||||
def is_active(self, request: Optional[WSGIRequest]) -> bool: ...
|
||||
10
django/views/decorators/cache.pyi
Normal file
10
django/views/decorators/cache.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import (
|
||||
Callable,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def cache_page(timeout: Union[float, int], *, cache = ..., key_prefix = ...) -> Callable: ...
|
||||
|
||||
|
||||
def never_cache(view_func: Callable) -> Callable: ...
|
||||
26
django/views/decorators/csrf.pyi
Normal file
26
django/views/decorators/csrf.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
from csrf_tests.tests import TestingHttpRequest
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
|
||||
def csrf_exempt(view_func: Callable) -> Callable: ...
|
||||
|
||||
|
||||
class _EnsureCsrfCookie:
|
||||
def _reject(self, request: TestingHttpRequest, reason: str) -> None: ...
|
||||
def process_view(
|
||||
self,
|
||||
request: TestingHttpRequest,
|
||||
callback: Callable,
|
||||
callback_args: Tuple,
|
||||
callback_kwargs: Dict[Any, Any]
|
||||
) -> None: ...
|
||||
|
||||
|
||||
class _EnsureCsrfToken:
|
||||
def _reject(self, request: HttpRequest, reason: str) -> None: ...
|
||||
7
django/views/decorators/debug.pyi
Normal file
7
django/views/decorators/debug.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Callable
|
||||
|
||||
|
||||
def sensitive_post_parameters(*parameters) -> Callable: ...
|
||||
|
||||
|
||||
def sensitive_variables(*variables) -> Callable: ...
|
||||
13
django/views/decorators/http.pyi
Normal file
13
django/views/decorators/http.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import (
|
||||
Callable,
|
||||
List,
|
||||
)
|
||||
|
||||
|
||||
def condition(etag_func: Callable = ..., last_modified_func: None = ...) -> Callable: ...
|
||||
|
||||
|
||||
def etag(etag_func: Callable) -> Callable: ...
|
||||
|
||||
|
||||
def require_http_methods(request_method_list: List[str]) -> Callable: ...
|
||||
7
django/views/decorators/vary.pyi
Normal file
7
django/views/decorators/vary.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Callable
|
||||
|
||||
|
||||
def vary_on_cookie(func: Callable) -> Callable: ...
|
||||
|
||||
|
||||
def vary_on_headers(*headers) -> Callable: ...
|
||||
40
django/views/defaults.pyi
Normal file
40
django/views/defaults.pyi
Normal file
@@ -0,0 +1,40 @@
|
||||
from django.core.exceptions import (
|
||||
PermissionDenied,
|
||||
SuspiciousOperation,
|
||||
)
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import (
|
||||
Http404,
|
||||
HttpResponseBadRequest,
|
||||
HttpResponseForbidden,
|
||||
HttpResponseNotFound,
|
||||
HttpResponseServerError,
|
||||
)
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def bad_request(
|
||||
request: WSGIRequest,
|
||||
exception: SuspiciousOperation,
|
||||
template_name: str = ...
|
||||
) -> HttpResponseBadRequest: ...
|
||||
|
||||
|
||||
def page_not_found(
|
||||
request: WSGIRequest,
|
||||
exception: Optional[Http404],
|
||||
template_name: str = ...
|
||||
) -> HttpResponseNotFound: ...
|
||||
|
||||
|
||||
def permission_denied(
|
||||
request: WSGIRequest,
|
||||
exception: PermissionDenied,
|
||||
template_name: str = ...
|
||||
) -> HttpResponseForbidden: ...
|
||||
|
||||
|
||||
def server_error(
|
||||
request: WSGIRequest,
|
||||
template_name: str = ...
|
||||
) -> HttpResponseServerError: ...
|
||||
78
django/views/generic/base.pyi
Normal file
78
django/views/generic/base.pyi
Normal file
@@ -0,0 +1,78 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import (
|
||||
HttpResponse,
|
||||
HttpResponseNotAllowed,
|
||||
HttpResponseRedirect,
|
||||
HttpResponseRedirectBase,
|
||||
)
|
||||
from django.template.response import TemplateResponse
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
List,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class ContextMixin:
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
|
||||
|
||||
class RedirectView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseRedirectBase: ...
|
||||
def get_redirect_url(self, *args, **kwargs) -> str: ...
|
||||
def options(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseRedirect: ...
|
||||
def post(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
|
||||
class TemplateResponseMixin:
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
def render_to_response(
|
||||
self,
|
||||
context: Dict[str, Any],
|
||||
**response_kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class TemplateView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class View:
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
def _allowed_methods(self) -> List[str]: ...
|
||||
@classmethod
|
||||
def as_view(cls, **initkwargs) -> Callable: ...
|
||||
def dispatch(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> Union[View, HttpResponse]: ...
|
||||
def http_method_not_allowed(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseNotAllowed: ...
|
||||
138
django/views/generic/dates.pyi
Normal file
138
django/views/generic/dates.pyi
Normal file
@@ -0,0 +1,138 @@
|
||||
from datetime import date
|
||||
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.list import MultipleObjectTemplateResponseMixin
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def _date_from_string(
|
||||
year: int,
|
||||
year_format: str,
|
||||
month: str = ...,
|
||||
month_format: str = ...,
|
||||
day: Union[str, int] = ...,
|
||||
day_format: str = ...,
|
||||
delim: str = ...
|
||||
) -> date: ...
|
||||
|
||||
|
||||
def _get_next_prev(
|
||||
generic_view: MultipleObjectTemplateResponseMixin,
|
||||
date: date,
|
||||
is_previous: bool,
|
||||
period: str
|
||||
) -> Optional[date]: ...
|
||||
|
||||
|
||||
def timezone_today() -> date: ...
|
||||
|
||||
|
||||
class BaseArchiveIndexView:
|
||||
def get_dated_items(self) -> Tuple[QuerySet, QuerySet, Dict[Any, Any]]: ...
|
||||
|
||||
|
||||
class BaseDateDetailView:
|
||||
def get_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
|
||||
|
||||
class BaseDateListView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
def get_date_list(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
date_type: None = ...,
|
||||
ordering: str = ...
|
||||
) -> QuerySet: ...
|
||||
def get_date_list_period(self) -> str: ...
|
||||
def get_dated_queryset(self, **lookup) -> QuerySet: ...
|
||||
def get_ordering(self) -> Union[str, Tuple[str, str]]: ...
|
||||
|
||||
|
||||
class BaseDayArchiveView:
|
||||
def _get_dated_items(
|
||||
self,
|
||||
date: date
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, Union[date, None]]], Tuple[None, QuerySet, Dict[str, date]]]: ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Union[Tuple[None, QuerySet, Dict[str, Union[date, None]]], Tuple[None, QuerySet, Dict[str, date]]]: ...
|
||||
|
||||
|
||||
class BaseMonthArchiveView:
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Union[Tuple[QuerySet, QuerySet, Dict[str, Union[date, None]]], Tuple[QuerySet, QuerySet, Dict[str, date]]]: ...
|
||||
|
||||
|
||||
class BaseTodayArchiveView:
|
||||
def get_dated_items(self): ...
|
||||
|
||||
|
||||
class BaseWeekArchiveView:
|
||||
def get_dated_items(self) -> Tuple[None, QuerySet, Dict[str, date]]: ...
|
||||
|
||||
|
||||
class BaseYearArchiveView:
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Union[Tuple[QuerySet, QuerySet, Dict[str, Union[date, None]]], Tuple[QuerySet, QuerySet, Dict[str, date]]]: ...
|
||||
def get_make_object_list(self) -> bool: ...
|
||||
|
||||
|
||||
class DateMixin:
|
||||
def _make_date_lookup_arg(self, value: date) -> date: ...
|
||||
def _make_single_date_lookup(self, date: date) -> Dict[str, date]: ...
|
||||
def get_allow_future(self) -> bool: ...
|
||||
def get_date_field(self) -> str: ...
|
||||
@cached_property
|
||||
def uses_datetime_field(self) -> bool: ...
|
||||
|
||||
|
||||
class DayMixin:
|
||||
def _get_current_day(self, date: date) -> date: ...
|
||||
def _get_next_day(self, date: date) -> date: ...
|
||||
def get_day(self) -> int: ...
|
||||
def get_day_format(self) -> str: ...
|
||||
def get_next_day(self, date: date) -> None: ...
|
||||
def get_previous_day(self, date: date) -> date: ...
|
||||
|
||||
|
||||
class MonthMixin:
|
||||
def _get_current_month(self, date: date) -> date: ...
|
||||
def _get_next_month(self, date: date) -> date: ...
|
||||
def get_month(self) -> Union[str, int]: ...
|
||||
def get_month_format(self) -> str: ...
|
||||
def get_next_month(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_month(self, date: date) -> Optional[date]: ...
|
||||
|
||||
|
||||
class WeekMixin:
|
||||
def _get_current_week(self, date: date) -> date: ...
|
||||
def _get_next_week(self, date: date) -> date: ...
|
||||
def _get_weekday(self, date: date) -> int: ...
|
||||
def get_next_week(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_week(self, date: date) -> Optional[date]: ...
|
||||
def get_week(self) -> int: ...
|
||||
def get_week_format(self) -> str: ...
|
||||
|
||||
|
||||
class YearMixin:
|
||||
def _get_current_year(self, date: date) -> date: ...
|
||||
def _get_next_year(self, date: date) -> date: ...
|
||||
def get_next_year(self, date: date) -> Optional[date]: ...
|
||||
def get_previous_year(self, date: date) -> Optional[date]: ...
|
||||
def get_year(self) -> int: ...
|
||||
def get_year_format(self) -> str: ...
|
||||
32
django/views/generic/detail.pyi
Normal file
32
django/views/generic/detail.pyi
Normal file
@@ -0,0 +1,32 @@
|
||||
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 typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class BaseDetailView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
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_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
def get_slug_field(self) -> str: ...
|
||||
|
||||
|
||||
class SingleObjectTemplateResponseMixin:
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
86
django/views/generic/edit.pyi
Normal file
86
django/views/generic/edit.pyi
Normal file
@@ -0,0 +1,86 @@
|
||||
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.response import HttpResponseRedirect
|
||||
from django.template.response import TemplateResponse
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Optional,
|
||||
Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class BaseCreateView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class BaseUpdateView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class DeletionMixin:
|
||||
def delete(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseRedirect: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
def post(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> HttpResponseRedirect: ...
|
||||
|
||||
|
||||
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_initial(self) -> Dict[Any, Any]: ...
|
||||
def get_prefix(self) -> None: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
|
||||
|
||||
class ModelFormMixin:
|
||||
def get_form_class(self) -> Type[ModelForm]: ...
|
||||
def get_form_kwargs(
|
||||
self
|
||||
) -> Dict[str, Union[None, MultiValueDict, Model]]: ...
|
||||
def get_success_url(self) -> str: ...
|
||||
|
||||
|
||||
class ProcessFormView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
def post(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> Union[TemplateResponse, HttpResponseRedirect]: ...
|
||||
54
django/views/generic/list.pyi
Normal file
54
django/views/generic/list.pyi
Normal file
@@ -0,0 +1,54 @@
|
||||
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 typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class BaseListView:
|
||||
def get(
|
||||
self,
|
||||
request: WSGIRequest,
|
||||
*args,
|
||||
**kwargs
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
class MultipleObjectMixin:
|
||||
def get_allow_empty(self) -> bool: ...
|
||||
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]]]]
|
||||
) -> Optional[str]: ...
|
||||
def get_ordering(self) -> None: ...
|
||||
def get_paginate_by(self, queryset: Union[QuerySet, List[Dict[str, str]]]) -> Optional[int]: ...
|
||||
def get_paginate_orphans(self) -> int: ...
|
||||
def get_paginator(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
per_page: int,
|
||||
orphans: int = ...,
|
||||
allow_empty_first_page: bool = ...,
|
||||
**kwargs
|
||||
) -> Paginator: ...
|
||||
def get_queryset(self) -> Union[QuerySet, List[Dict[str, str]]]: ...
|
||||
def paginate_queryset(
|
||||
self,
|
||||
queryset: QuerySet,
|
||||
page_size: int
|
||||
) -> Tuple[Paginator, Page, QuerySet, bool]: ...
|
||||
|
||||
|
||||
class MultipleObjectTemplateResponseMixin:
|
||||
def get_template_names(self) -> List[str]: ...
|
||||
44
django/views/i18n.pyi
Normal file
44
django/views/i18n.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import (
|
||||
HttpResponse,
|
||||
HttpResponseRedirect,
|
||||
JsonResponse,
|
||||
)
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def get_formats() -> Dict[str, Union[str, int, List[str]]]: ...
|
||||
|
||||
|
||||
def set_language(request: WSGIRequest) -> HttpResponseRedirect: ...
|
||||
|
||||
|
||||
class JSONCatalog:
|
||||
def render_to_response(
|
||||
self,
|
||||
context: Dict[str, Union[Dict[str, Union[str, List[str]]], Dict[str, Union[str, int, List[str]]], str]],
|
||||
**response_kwargs
|
||||
) -> JsonResponse: ...
|
||||
|
||||
|
||||
class JavaScriptCatalog:
|
||||
@property
|
||||
def _num_plurals(self) -> int: ...
|
||||
@property
|
||||
def _plural_string(self) -> Optional[str]: ...
|
||||
def get(self, request: WSGIRequest, *args, **kwargs) -> HttpResponse: ...
|
||||
def get_catalog(self) -> Dict[str, Union[str, List[str]]]: ...
|
||||
def get_context_data(self, **kwargs) -> Dict[str, Any]: ...
|
||||
def get_paths(self, packages: List[str]) -> List[str]: ...
|
||||
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]]]]],
|
||||
**response_kwargs
|
||||
) -> HttpResponse: ...
|
||||
24
django/views/static.pyi
Normal file
24
django/views/static.pyi
Normal file
@@ -0,0 +1,24 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.http.response import (
|
||||
FileResponse,
|
||||
HttpResponse,
|
||||
)
|
||||
from pathlib import PosixPath
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def directory_index(path: str, fullpath: PosixPath) -> HttpResponse: ...
|
||||
|
||||
|
||||
def serve(
|
||||
request: WSGIRequest,
|
||||
path: str,
|
||||
document_root: str = ...,
|
||||
show_indexes: bool = ...
|
||||
) -> Union[HttpResponse, FileResponse]: ...
|
||||
|
||||
|
||||
def was_modified_since(header: Optional[str] = ..., mtime: float = ..., size: int = ...) -> bool: ...
|
||||
Reference in New Issue
Block a user