Skip to content

Commit a616717

Browse files
authored
[5.2] Improve django.http.request.MediaType (#2631)
1 parent 6bdd5ab commit a616717

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

django-stubs/http/request.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ class MediaType:
202202
@property
203203
def is_all_types(self) -> bool: ...
204204
def match(self, other: str) -> bool: ...
205+
@cached_property
206+
def quality(self) -> float: ...
207+
@property
208+
def specificity(self) -> int: ...
205209

206210
@overload
207211
def bytes_to_text(s: None, encoding: str) -> None: ...

scripts/stubtest/allowlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ django.http.HttpRequest.headers
398398
django.http.HttpResponse.text
399399
django.http.request.HttpRequest.accepted_types
400400
django.http.request.HttpRequest.headers
401+
django.http.request.MediaType.quality
401402
django.http.response.HttpResponse.text
402403
django.middleware.csrf.CsrfViewMiddleware.allowed_origin_subdomains
403404
django.middleware.csrf.CsrfViewMiddleware.allowed_origins_exact

scripts/stubtest/allowlist_todo_django52.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ django.http.QueryDict.pop
172172
django.http.StreamingHttpResponse.text
173173
django.http.request.HttpRequest.accepted_type
174174
django.http.request.HttpRequest.get_preferred_type
175-
django.http.request.MediaType.quality
176-
django.http.request.MediaType.specificity
177175
django.http.request.QueryDict.pop
178176
django.http.response.StreamingHttpResponse.text
179177
django.template.Library.simple_block_tag

0 commit comments

Comments
 (0)