Skip to content

Commit

Permalink
Add accepted_renderer, accepted_media_type to Request and Response (#649
Browse files Browse the repository at this point in the history
)
  • Loading branch information
q0w authored Sep 11, 2024
1 parent c0930f1 commit dc75658
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rest_framework-stubs/request.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ from rest_framework.authentication import BaseAuthentication
from rest_framework.authtoken.models import Token
from rest_framework.negotiation import BaseContentNegotiation
from rest_framework.parsers import BaseParser
from rest_framework.renderers import BaseRenderer
from rest_framework.versioning import BaseVersioning
from rest_framework.views import APIView
from typing_extensions import Self
Expand Down Expand Up @@ -47,6 +48,8 @@ class Request(HttpRequest):
parsers: Sequence[BaseParser] | None
authenticators: Sequence[BaseAuthentication | ForcedAuthentication] | None
negotiator: BaseContentNegotiation | None
accepted_renderer: BaseRenderer | None
accepted_media_type: str | None
parser_context: dict[str, Any]
version: str | None
versioning_scheme: BaseVersioning | None
Expand Down
3 changes: 3 additions & 0 deletions rest_framework-stubs/response.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from django.template.base import Template
from django.template.response import SimpleTemplateResponse
from django.test.utils import ContextList
from django.urls import ResolverMatch
from rest_framework.renderers import BaseRenderer
from rest_framework.request import Request
from rest_framework.test import APIClient
from typing_extensions import Self
Expand All @@ -13,6 +14,8 @@ class Response(SimpleTemplateResponse):
data: Any
exception: bool
content_type: str | None
accepted_renderer: BaseRenderer | None
accepted_media_type: str | None
_request: Request
def __init__(
self,
Expand Down

0 comments on commit dc75658

Please sign in to comment.