Skip to content

Commit

Permalink
Closes #11766: Remove obsolete custom ChoiceField and MultipleChoiceF…
Browse files Browse the repository at this point in the history
…ield classes
  • Loading branch information
jeremystretch committed May 12, 2023
1 parent e40e9cb commit 02db0bc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 36 deletions.
13 changes: 0 additions & 13 deletions docs/plugins/development/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/release-notes/version-3.6.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
23 changes: 0 additions & 23 deletions netbox/utilities/forms/fields/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
from utilities.validators import EnhancedURLValidator

__all__ = (
'ChoiceField',
'ColorField',
'CommentField',
'JSONField',
'LaxURLField',
'MACAddressField',
'MultipleChoiceField',
'SlugField',
'TagFilterField',
)
Expand Down Expand Up @@ -128,24 +126,3 @@ def to_python(self, value):
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

0 comments on commit 02db0bc

Please sign in to comment.