mirror of https://github.com/django/django.git
Fixed #27199 -- Made AdminIntegerFieldWidget use NumberInput.
This commit is contained in:
parent
dab653cadc
commit
ca9c69a968
|
@ -385,7 +385,7 @@ class AdminURLFieldWidget(forms.URLInput):
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
class AdminIntegerFieldWidget(forms.TextInput):
|
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||||
class_name = 'vIntegerField'
|
class_name = 'vIntegerField'
|
||||||
|
|
||||||
def __init__(self, attrs=None):
|
def __init__(self, attrs=None):
|
||||||
|
|
|
@ -488,6 +488,9 @@ Miscellaneous
|
||||||
``migrate`` command. Use the new :djadmin:`remove_stale_contenttypes` command
|
``migrate`` command. Use the new :djadmin:`remove_stale_contenttypes` command
|
||||||
instead.
|
instead.
|
||||||
|
|
||||||
|
* The admin's widget for ``IntegerField`` uses ``type="number"`` rather than
|
||||||
|
``type="text"``.
|
||||||
|
|
||||||
.. _deprecated-features-1.11:
|
.. _deprecated-features-1.11:
|
||||||
|
|
||||||
Features deprecated in 1.11
|
Features deprecated in 1.11
|
||||||
|
|
|
@ -366,13 +366,13 @@ class TestInline(TestDataMixin, TestCase):
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'<input class="vIntegerField" id="id_editablepkbook_set-0-manual_pk" '
|
'<input class="vIntegerField" id="id_editablepkbook_set-0-manual_pk" '
|
||||||
'name="editablepkbook_set-0-manual_pk" type="text" />',
|
'name="editablepkbook_set-0-manual_pk" type="number" />',
|
||||||
html=True, count=1
|
html=True, count=1
|
||||||
)
|
)
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'<input class="vIntegerField" id="id_editablepkbook_set-2-0-manual_pk" '
|
'<input class="vIntegerField" id="id_editablepkbook_set-2-0-manual_pk" '
|
||||||
'name="editablepkbook_set-2-0-manual_pk" type="text" />',
|
'name="editablepkbook_set-2-0-manual_pk" type="number" />',
|
||||||
html=True, count=1
|
html=True, count=1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue