mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-19 11:52:22 -06: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
f675e10240
commit
0e40cb0a1b
@@ -27,11 +27,11 @@ class ContentTypeChoiceField(ContentTypeChoiceMixin, forms.ModelChoiceField):
|
||||
"""
|
||||
Selection field for a single content type.
|
||||
"""
|
||||
widget = widgets.StaticSelect
|
||||
pass
|
||||
|
||||
|
||||
class ContentTypeMultipleChoiceField(ContentTypeChoiceMixin, forms.ModelMultipleChoiceField):
|
||||
"""
|
||||
Selection field for one or more content types.
|
||||
"""
|
||||
widget = widgets.StaticSelectMultiple
|
||||
pass
|
||||
|
||||
@@ -68,7 +68,6 @@ class TagFilterField(forms.MultipleChoiceField):
|
||||
|
||||
:param model: The model of the filter
|
||||
"""
|
||||
widget = widgets.StaticSelectMultiple
|
||||
|
||||
def __init__(self, model, *args, **kwargs):
|
||||
def get_choices():
|
||||
@@ -137,13 +136,16 @@ class MACAddressField(forms.Field):
|
||||
|
||||
class ChoiceField(forms.ChoiceField):
|
||||
"""
|
||||
Overrides Django's built-in `ChoiceField` to use NetBox's `StaticSelect` widget
|
||||
Previously used to override Django's built-in `ChoiceField` to use NetBox's now-obsolete `StaticSelect` widget.
|
||||
"""
|
||||
widget = widgets.StaticSelect
|
||||
# TODO: Remove in v3.6
|
||||
pass
|
||||
|
||||
|
||||
class MultipleChoiceField(forms.MultipleChoiceField):
|
||||
"""
|
||||
Overrides Django's built-in `MultipleChoiceField` to use NetBox's `StaticSelectMultiple` widget
|
||||
Previously used to override Django's built-in `MultipleChoiceField` to use NetBox's now-obsolete
|
||||
`StaticSelectMultiple` widget.
|
||||
"""
|
||||
widget = widgets.StaticSelectMultiple
|
||||
# TODO: Remove in v3.6
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user