Skip to content

Instantly share code, notes, and snippets.

@DanSheps
Last active March 26, 2020 00:38
Show Gist options
  • Save DanSheps/26bd66beb19321c8be7bd53df099078c to your computer and use it in GitHub Desktop.
Save DanSheps/26bd66beb19321c8be7bd53df099078c to your computer and use it in GitHub Desktop.
TimeVariable for Netbox Scripts
from extras.scripts import ScriptVariable
class TimeVar(ScriptVariable):
"""
An time entry
"""
form_field = forms.TimeZoneFormField
def __init__(self, choices, *args, **kwargs):
super().__init__(*args, **kwargs)
self.field_attrs['choices'] = choices
@ryanmerolle
Copy link

change to:

    def __init__(self, choices, *args, **kwargs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment