feat: rack photo appendix and virtualization cluster section

Rack image attachments can be picked with thumbnails in the export form and
are placed in an appendix, linked from below each rack elevation (Word:
internal hyperlinks to bookmarks). New section lists clusters with hosts and
summed VM resources, counting only VMs inside the export scope.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-10-28 15:17:17 +01:00
1 parent 74dfa0ec61
commit c888a65180
12 files changed
+314 -16

No files matched your search

+7 -1
View File
@@ -5,7 +5,7 @@ from circuits.models import Circuit
from dcim.models import Device, Location, PowerFeed, Rack, Site
from ipam.models import VLAN, VRF, IPAddress, Prefix
from tenancy.models import Tenant, TenantGroup
from virtualization.models import VirtualMachine
from virtualization.models import Cluster, VirtualMachine
from wireless.models import WirelessLAN
SCOPE_MODELS = {
@@ -81,6 +81,12 @@ class Scope:
def devices(self):
return self._qs(Device, site=("site",), location=("location",))
def clusters(self):
"""Cluster am Scope selbst oder mit Hosts/VMs im Scope."""
own = Cluster.objects.filter(self._q(site=("_site",), location=("_location",), tenant=("tenant",)))
q = Q(pk__in=own.values("pk")) | Q(pk__in=self.devices().values("cluster")) | Q(pk__in=self.virtual_machines().values("cluster"))
return self.restrict(Cluster.objects.filter(q).distinct())
def virtual_machines(self):
return self._qs(
VirtualMachine,