1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Update related object counts to use dunders in accessor

This commit is contained in:
Jeremy Stretch
2020-07-20 13:00:33 -04:00
parent de6202c160
commit 8514a5427c
3 changed files with 8 additions and 8 deletions

View File

@ -503,13 +503,13 @@ class DeviceRoleTable(BaseTable):
pk = ToggleColumn()
device_count = tables.TemplateColumn(
template_code=DEVICEROLE_DEVICE_COUNT,
accessor=Accessor('devices.unrestricted.count'),
accessor=Accessor('devices__unrestricted__count'),
orderable=False,
verbose_name='Devices'
)
vm_count = tables.TemplateColumn(
template_code=DEVICEROLE_VM_COUNT,
accessor=Accessor('virtual_machines.unrestricted.count'),
accessor=Accessor('virtual_machines__unrestricted__count'),
orderable=False,
verbose_name='VMs'
)
@ -534,13 +534,13 @@ class PlatformTable(BaseTable):
pk = ToggleColumn()
device_count = tables.TemplateColumn(
template_code=PLATFORM_DEVICE_COUNT,
accessor=Accessor('devices.count'),
accessor=Accessor('devices__unrestricted__count'),
orderable=False,
verbose_name='Devices'
)
vm_count = tables.TemplateColumn(
template_code=PLATFORM_VM_COUNT,
accessor=Accessor('virtual_machines.count'),
accessor=Accessor('virtual_machines__unrestricted__count'),
orderable=False,
verbose_name='VMs'
)