feat: switch stacks – stack members shown one below the other in the port panel

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-04 09:02:04 +01:00
1 parent 6906bf6ed6
commit 567daf7963
9 files changed
+200 -30

No files matched your search

+23
View File
@@ -88,6 +88,29 @@ class DeviceRackPlacement(models.Model):
return f"{self.device}: 1/{self.width}, Position {self.horizontal_position}"
class SwitchStack(models.Model):
"""A switch that represents a stack; its members are shown one below the other in the port panel."""
device = models.OneToOneField(
"dcim.Device",
on_delete=models.CASCADE,
related_name="netbox_utilities_switch_stack",
)
members = models.ManyToManyField(
"dcim.Device",
blank=True,
related_name="netbox_utilities_stack_memberships",
)
updated = models.DateTimeField(auto_now=True)
class Meta:
verbose_name = "Switch-Stack"
verbose_name_plural = "Switch-Stacks"
def __str__(self):
return f"Stack {self.device}"
class CableVLANAssignment(models.Model):
cable = models.OneToOneField(
"dcim.Cable",