|
@@ -18,6 +18,7 @@ from ipam.formfields import IPAddressFormField, IPNetworkFormField
|
|
|
from ipam.validators import MaxPrefixLengthValidator, MinPrefixLengthValidator, prefix_validator
|
|
from ipam.validators import MaxPrefixLengthValidator, MinPrefixLengthValidator, prefix_validator
|
|
|
from .constants import LOG_DEFAULT, LOG_FAILURE, LOG_INFO, LOG_SUCCESS, LOG_WARNING
|
|
from .constants import LOG_DEFAULT, LOG_FAILURE, LOG_INFO, LOG_SUCCESS, LOG_WARNING
|
|
|
from utilities.exceptions import AbortTransaction
|
|
from utilities.exceptions import AbortTransaction
|
|
|
|
|
+from utilities.forms import DynamicModelChoiceField, DynamicModelMultipleChoiceField
|
|
|
from .forms import ScriptForm
|
|
from .forms import ScriptForm
|
|
|
from .signals import purge_changelog
|
|
from .signals import purge_changelog
|
|
|
|
|
|
|
@@ -197,6 +198,20 @@ class MultiObjectVar(ScriptVariable):
|
|
|
self.form_field = TreeNodeMultipleChoiceField
|
|
self.form_field = TreeNodeMultipleChoiceField
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+class DynamicObjectVar(ObjectVar):
|
|
|
|
|
+ """
|
|
|
|
|
+ A dynamic netbox object variable. APISelect will determine the available choices
|
|
|
|
|
+ """
|
|
|
|
|
+ form_field = DynamicModelChoiceField
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+class DynamicMultiObjectVar(MultiObjectVar):
|
|
|
|
|
+ """
|
|
|
|
|
+ A multiple choice version of DynamicObjectVar
|
|
|
|
|
+ """
|
|
|
|
|
+ form_field = DynamicModelMultipleChoiceField
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
class FileVar(ScriptVariable):
|
|
class FileVar(ScriptVariable):
|
|
|
"""
|
|
"""
|
|
|
An uploaded file.
|
|
An uploaded file.
|