mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-22 03:41:28 +08:00
make pep561 compliant
This commit is contained in:
40
django-stubs/views/defaults.pyi
Normal file
40
django-stubs/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: ...
|
||||
Reference in New Issue
Block a user