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

Closes #5375: Add 'speed' attribute to console port models

This commit is contained in:
Jeremy Stretch
2021-03-03 10:20:08 -05:00
parent 51120ccf31
commit 8de20fcd1f
10 changed files with 149 additions and 32 deletions

View File

@@ -24,6 +24,7 @@ __all__ = (
'CSVContentTypeField',
'CSVDataField',
'CSVModelChoiceField',
'CSVTypedChoiceField',
'DynamicModelChoiceField',
'DynamicModelMultipleChoiceField',
'ExpandableIPAddressField',
@@ -125,6 +126,10 @@ class CSVChoiceField(forms.ChoiceField):
self.choices = unpack_grouped_choices(choices)
class CSVTypedChoiceField(forms.TypedChoiceField):
STATIC_CHOICES = True
class CSVModelChoiceField(forms.ModelChoiceField):
"""
Provides additional validation for model choices entered as CSV data.