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
|
||||
|
||||
|
||||
class AdminIntegerFieldWidget(forms.TextInput):
|
||||
class AdminIntegerFieldWidget(forms.NumberInput):
|
||||
class_name = 'vIntegerField'
|
||||
|
||||
def __init__(self, attrs=None):
|
||||
|
|
|
@ -488,6 +488,9 @@ Miscellaneous
|
|||
``migrate`` command. Use the new :djadmin:`remove_stale_contenttypes` command
|
||||
instead.
|
||||
|
||||
* The admin's widget for ``IntegerField`` uses ``type="number"`` rather than
|
||||
``type="text"``.
|
||||
|
||||
.. _deprecated-features-1.11:
|
||||
|
||||
Features deprecated in 1.11
|
||||
|
|
|
@ -366,13 +366,13 @@ class TestInline(TestDataMixin, TestCase):
|
|||
self.assertContains(
|
||||
response,
|
||||
'<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
|
||||
)
|
||||
self.assertContains(
|
||||
response,
|
||||
'<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
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue