Skip to content

Commit 1d1236a

Browse files
authored
Update django.forms.widgets for Django 5.2 (#2608)
1 parent c5316de commit 1d1236a

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

django-stubs/forms/widgets.pyi

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ _OptAttrs: TypeAlias = dict[str, Any]
1414

1515
class MediaOrderConflictWarning(RuntimeWarning): ...
1616

17+
class MediaAsset:
18+
element_template: str
19+
20+
def __init__(self, path: str, **attributes: _OptAttrs) -> None: ...
21+
def __eq__(self, other: object) -> bool: ...
22+
def __hash__(self) -> int: ...
23+
def __html__(self) -> SafeString: ...
24+
@property
25+
def path(self) -> str: ...
26+
27+
class Script(MediaAsset):
28+
element_template: str
29+
30+
def __init__(self, src: str, **attributes: _OptAttrs) -> None: ...
31+
1732
class Media:
1833
def __init__(
1934
self,
@@ -77,6 +92,18 @@ class URLInput(Input):
7792
input_type: str
7893
template_name: str
7994

95+
class ColorInput(Input):
96+
input_type: str
97+
template_name: str
98+
99+
class SearchInput(Input):
100+
input_type: str
101+
template_name: str
102+
103+
class TelInput(Input):
104+
input_type: str
105+
template_name: str
106+
80107
class PasswordInput(Input):
81108
render_value: bool
82109
input_type: str

scripts/stubtest/allowlist_todo_django52.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ django.forms.forms.BaseForm.bound_field_class
207207
django.forms.models.ModelChoiceField.validate_no_null_characters
208208
django.forms.renderers.BaseRenderer.bound_field_class
209209
django.forms.utils.ErrorList.__init__
210-
django.forms.widgets.ColorInput
211-
django.forms.widgets.Script
212-
django.forms.widgets.SearchInput
213-
django.forms.widgets.TelInput
214210
django.http.HttpRequest.accepted_type
215211
django.http.HttpRequest.get_preferred_type
216212
django.http.HttpResponse.text

0 commit comments

Comments
 (0)