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

Closes #11765: Remove StaticSelect & StaticSelectMultiple (#11767)

* Remove StaticSelect, StaticSelectMultiple form widgets

* Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
This commit is contained in:
Jeremy Stretch
2023-02-16 10:25:51 -05:00
committed by jeremystretch
parent c73829fe92
commit b9bd96f0c7
30 changed files with 221 additions and 485 deletions

View File

@@ -21,8 +21,6 @@ __all__ = (
'SelectSpeedWidget',
'SelectWithPK',
'SlugWidget',
'StaticSelect',
'StaticSelectMultiple',
'TimePicker',
)
@@ -68,26 +66,7 @@ class BulkEditNullBooleanSelect(forms.NullBooleanSelect):
self.attrs['class'] = 'netbox-static-select'
class StaticSelect(forms.Select):
"""
A static <select/> form widget which is client-side rendered.
"""
option_template_name = 'widgets/select_option.html'
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.attrs['class'] = 'netbox-static-select'
class StaticSelectMultiple(StaticSelect, forms.SelectMultiple):
"""
Extends `StaticSelect` to support multiple selections.
"""
pass
class SelectWithPK(StaticSelect):
class SelectWithPK(forms.Select):
"""
Include the primary key of each option in the option label (e.g. "Router7 (4721)").
"""