mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #4885: Add MultiChoiceVar for custom scripts
This commit is contained in:
@ -32,6 +32,7 @@ __all__ = [
|
||||
'IPAddressVar',
|
||||
'IPAddressWithMaskVar',
|
||||
'IPNetworkVar',
|
||||
'MultiChoiceVar',
|
||||
'MultiObjectVar',
|
||||
'ObjectVar',
|
||||
'Script',
|
||||
@ -165,6 +166,13 @@ class ChoiceVar(ScriptVariable):
|
||||
self.field_attrs['choices'] = choices
|
||||
|
||||
|
||||
class MultiChoiceVar(ChoiceVar):
|
||||
"""
|
||||
Like ChoiceVar, but allows for the selection of multiple choices.
|
||||
"""
|
||||
form_field = forms.MultipleChoiceField
|
||||
|
||||
|
||||
class ObjectVar(ScriptVariable):
|
||||
"""
|
||||
A single object within NetBox.
|
||||
|
Reference in New Issue
Block a user