1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #7153: Allow clearing of assigned device type images

This commit is contained in:
jeremystretch
2021-09-02 16:48:54 -04:00
parent a3069239e9
commit a1110b07de
6 changed files with 64 additions and 20 deletions

View File

@ -12,6 +12,7 @@ __all__ = (
'APISelect',
'APISelectMultiple',
'BulkEditNullBooleanSelect',
'ClearableFileInput',
'ColorSelect',
'ContentTypeSelect',
'DatePicker',
@ -135,6 +136,13 @@ class NumericArrayField(SimpleArrayField):
return super().to_python(value)
class ClearableFileInput(forms.ClearableFileInput):
"""
Override Django's stock ClearableFileInput with a custom template.
"""
template_name = 'widgets/clearable_file_input.html'
class APISelect(SelectWithDisabled):
"""
A select widget populated via an API call