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

Closes #11766: Remove obsolete custom ChoiceField and MultipleChoiceField classes

This commit is contained in:
jeremystretch
2023-05-12 16:21:22 -04:00
parent e40e9cb406
commit 02db0bcc2e
4 changed files with 8 additions and 36 deletions

View File

@ -165,19 +165,6 @@ In addition to the [form fields provided by Django](https://docs.djangoproject.c
options:
members: false
## Choice Fields
!!! warning "Obsolete Fields"
NetBox's custom `ChoiceField` and `MultipleChoiceField` classes are no longer necessary thanks to improvements made to the user interface. Django's native form fields can be used instead. These custom field classes will be removed in NetBox v3.6.
::: utilities.forms.fields.ChoiceField
options:
members: false
::: utilities.forms.fields.MultipleChoiceField
options:
members: false
## Dynamic Object Fields
::: utilities.forms.fields.DynamicModelChoiceField

View File

@ -0,0 +1,7 @@
# NetBox v3.6
## v3.6.0 (FUTURE)
### Other Changes
* [#11766](https://github.com/netbox-community/netbox/issues/11766) - Remove obsolete custom `ChoiceField` and `MultipleChoiceField` classes

View File

@ -273,6 +273,7 @@ nav:
- git Cheat Sheet: 'development/git-cheat-sheet.md'
- Release Notes:
- Summary: 'release-notes/index.md'
- Version 3.6: 'release-notes/version-3.6.md'
- Version 3.5: 'release-notes/version-3.5.md'
- Version 3.4: 'release-notes/version-3.4.md'
- Version 3.3: 'release-notes/version-3.3.md'

View File

@ -11,13 +11,11 @@ from utilities.forms import widgets
from utilities.validators import EnhancedURLValidator
__all__ = (
'ChoiceField',
'ColorField',
'CommentField',
'JSONField',
'LaxURLField',
'MACAddressField',
'MultipleChoiceField',
'SlugField',
'TagFilterField',
)
@ -128,24 +126,3 @@ class MACAddressField(forms.Field):
raise forms.ValidationError(self.error_messages['invalid'], code='invalid')
return value
#
# Choice fields
#
class ChoiceField(forms.ChoiceField):
"""
Previously used to override Django's built-in `ChoiceField` to use NetBox's now-obsolete `StaticSelect` widget.
"""
# TODO: Remove in v3.6
pass
class MultipleChoiceField(forms.MultipleChoiceField):
"""
Previously used to override Django's built-in `MultipleChoiceField` to use NetBox's now-obsolete
`StaticSelectMultiple` widget.
"""
# TODO: Remove in v3.6
pass