Explorar o código

fix(ui): Display nested group and platform hierarchies

Replace RelatedObjectAttr with NestedObjectAttr for Tenant Groups,
Wireless LAN Groups, and Device Type default platforms. Limit Platform
hierarchies to three levels for consistency with existing Platform
fields.

Fixes #22954
Martin Hauser hai 3 días
pai
achega
3f662dd222

+ 1 - 1
netbox/dcim/ui/panels.py

@@ -150,7 +150,7 @@ class DeviceTypePanel(panels.ObjectAttributesPanel):
     manufacturer = attrs.RelatedObjectAttr('manufacturer', linkify=True)
     model = attrs.TextAttr('model')
     part_number = attrs.TextAttr('part_number')
-    default_platform = attrs.RelatedObjectAttr('default_platform', linkify=True)
+    default_platform = attrs.NestedObjectAttr('default_platform', linkify=True, max_depth=3)
     description = attrs.TextAttr('description')
     height = attrs.TemplatedAttr('u_height', template_name='dcim/devicetype/attrs/height.html')
     exclude_from_utilization = attrs.BooleanAttr('exclude_from_utilization')

+ 1 - 1
netbox/tenancy/ui/panels.py

@@ -4,7 +4,7 @@ from netbox.ui import attrs, panels
 
 
 class TenantPanel(panels.ObjectAttributesPanel):
-    group = attrs.RelatedObjectAttr('group', linkify=True)
+    group = attrs.NestedObjectAttr('group', linkify=True)
     description = attrs.TextAttr('description')
 
 

+ 1 - 1
netbox/virtualization/ui/panels.py

@@ -24,7 +24,7 @@ class ClusterPanel(panels.ObjectAttributesPanel):
 
 class VirtualMachineTypePanel(panels.ObjectAttributesPanel):
     name = attrs.TextAttr('name')
-    default_platform = attrs.RelatedObjectAttr('default_platform', linkify=True)
+    default_platform = attrs.NestedObjectAttr('default_platform', linkify=True, max_depth=3)
     default_vcpus = attrs.TextAttr('default_vcpus', label=_('Default vCPUs'))
     default_memory = attrs.TemplatedAttr(
         'default_memory',

+ 1 - 1
netbox/wireless/ui/panels.py

@@ -9,7 +9,7 @@ class WirelessLANGroupPanel(panels.NestedGroupObjectPanel):
 
 class WirelessLANPanel(panels.ObjectAttributesPanel):
     ssid = attrs.TextAttr('ssid', label=_('SSID'))
-    group = attrs.RelatedObjectAttr('group', linkify=True)
+    group = attrs.NestedObjectAttr('group', linkify=True)
     status = attrs.ChoiceAttr('status')
     scope = attrs.GenericForeignKeyAttr('scope', linkify=True, nested=True, max_depth=3)
     description = attrs.TextAttr('description')