Last active
March 26, 2020 00:38
-
-
Save DanSheps/26bd66beb19321c8be7bd53df099078c to your computer and use it in GitHub Desktop.
TimeVariable for Netbox Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
change to: