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): |
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 dcim.models import * | |
from extras.scripts import ObjectVar, Script | |
class OSPPatchFrontPorts(Script): | |
name = "Outside Plant - Patch Front Ports" | |
description = "Patch all front ports through" | |
site = ObjectVar( |
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
def trace(port, graph=None, last=None, position_stack=None): | |
if position_stack is None: | |
position_stack = [] | |
nodes = [] | |
paths = [] | |
# Add edge if last is set. Supports: Cables, WirelessLinks, PortPair. Todo: Bridges | |
if last: | |
if isinstance(port, RearPort) and isinstance(last, FrontPort): |