mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Remove StaticSelect, StaticSelectMultiple form widgets * Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
This commit is contained in:
committed by
jeremystretch
parent
c73829fe92
commit
b9bd96f0c7
@@ -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)").
|
||||
"""
|
||||
|
Reference in New Issue
Block a user