Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update admin.sites._ViewType bound to allow StreamingHttpResponse #2256

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django-stubs/contrib/admin/sites.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ from django.core.checks import CheckMessage
from django.db.models.base import Model
from django.db.models.query import QuerySet
from django.http.request import HttpRequest
from django.http.response import HttpResponse
from django.http.response import HttpResponse, StreamingHttpResponse
from django.template.response import TemplateResponse
from django.urls import URLPattern, URLResolver
from django.utils.functional import LazyObject, _StrOrPromise
Expand All @@ -25,7 +25,7 @@ else:

all_sites: MutableSet[AdminSite]

_ViewType = TypeVar("_ViewType", bound=Callable[..., HttpResponse])
_ViewType = TypeVar("_ViewType", bound=Callable[..., HttpResponse | StreamingHttpResponse])
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
_ModelT = TypeVar("_ModelT", bound=Model)
_ActionCallback: TypeAlias = Callable[[ModelAdmin, HttpRequest, QuerySet], TemplateResponse | None]

Expand Down
Loading