Skip to content

Commit

Permalink
5.0: Update django.views (#2007)
Browse files Browse the repository at this point in the history
* 5.0: Update `django.views`

* fixup! 5.0: Update `django.views`
  • Loading branch information
ngnpope authored Mar 14, 2024
1 parent 8b5596e commit 79a9051
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
4 changes: 3 additions & 1 deletion django-stubs/views/csrf.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from pathlib import Path

from django.http.request import HttpRequest
from django.http.response import HttpResponseForbidden

CSRF_FAILURE_TEMPLATE: str
CSRF_FAILURE_TEMPLATE_NAME: str

def builtin_template_path(name: str) -> Path: ...
def csrf_failure(request: HttpRequest, reason: str = ..., template_name: str = ...) -> HttpResponseForbidden: ...
4 changes: 3 additions & 1 deletion django-stubs/views/decorators/debug.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from collections.abc import Callable
from typing import Any, TypeVar
from typing import Any, Literal, TypeVar

_F = TypeVar("_F", bound=Callable[..., Any])

coroutine_functions_to_sensitive_variables: dict[int, Literal["__ALL__"] | tuple[str, ...]]

def sensitive_variables(*variables: str) -> Callable[[_F], _F]: ...
def sensitive_post_parameters(*parameters: str) -> Callable[[_F], _F]: ...
3 changes: 0 additions & 3 deletions django-stubs/views/generic/edit.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ class DeletionMixin(Generic[_M]):

class BaseDeleteView(Generic[_M, _ModelFormT], DeletionMixin[_M], FormMixin[_ModelFormT], BaseDetailView[_M]):
object: _M
def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class DeleteView(Generic[_M, _ModelFormT], SingleObjectTemplateResponseMixin, BaseDeleteView[_M, _ModelFormT]):
object: _M
template_name_suffix: str

class DeleteViewCustomDeleteWarning(Warning): ...
4 changes: 2 additions & 2 deletions django-stubs/views/i18n.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections.abc import Callable
from pathlib import Path
from typing import Any

from django.http.request import HttpRequest
Expand All @@ -8,11 +9,10 @@ from django.views.generic import View

LANGUAGE_QUERY_PARAMETER: str

def builtin_template_path(name: str) -> Path: ...
def set_language(request: HttpRequest) -> HttpResponse: ...
def get_formats() -> dict[str, list[str] | int | str]: ...

js_catalog_template: str

class JavaScriptCatalog(View):
head: Callable
domain: str
Expand Down
3 changes: 2 additions & 1 deletion django-stubs/views/static.pyi
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from pathlib import Path
from typing import Any

from django.http import FileResponse, HttpResponse
from django.http.request import HttpRequest

def builtin_template_path(name: str) -> Path: ...
def serve(
request: HttpRequest, path: str, document_root: str | None = ..., show_indexes: bool = ...
) -> FileResponse: ...

DEFAULT_DIRECTORY_INDEX_TEMPLATE: str
template_translatable: Any

def directory_index(path: Any, fullpath: Any) -> HttpResponse: ...
Expand Down
9 changes: 0 additions & 9 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,3 @@ django.utils.text.add_truncation_text
django.utils.timezone.make_aware
django.utils.timezone.utc
django.utils.topological_sort
django.views.csrf.CSRF_FAILURE_TEMPLATE
django.views.csrf.builtin_template_path
django.views.decorators.debug.coroutine_functions_to_sensitive_variables
django.views.generic.edit.BaseDeleteView.__init__
django.views.generic.edit.DeleteViewCustomDeleteWarning
django.views.i18n.builtin_template_path
django.views.i18n.js_catalog_template
django.views.static.DEFAULT_DIRECTORY_INDEX_TEMPLATE
django.views.static.builtin_template_path

0 comments on commit 79a9051

Please sign in to comment.