mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-20 08:34:58 +01:00
Initial work on custom scripts (#3415)
This commit is contained in:
@@ -380,3 +380,18 @@ class ObjectChangeFilterForm(BootstrapMixin, forms.Form):
|
||||
widget=ContentTypeSelect(),
|
||||
label='Object Type'
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Scripts
|
||||
#
|
||||
|
||||
class ScriptForm(BootstrapMixin, forms.Form):
|
||||
|
||||
def __init__(self, vars, *args, **kwargs):
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# Dynamically populate fields for variables
|
||||
for name, var in vars:
|
||||
self.fields[name] = var.as_field()
|
||||
|
||||
Reference in New Issue
Block a user