ClusterTable not showing the correct associated VM count #4591

Closed
opened 2025-12-29 18:38:03 +01:00 by adam · 2 comments
Owner

Originally created by @kuzmik on GitHub (Feb 24, 2021).

Environment

  • Python version: Python 3.8.5
  • NetBox version: 2.10.4

Steps to Reproduce

I am using the ClusterTable object to display a list of Clusters owned by a Tenant in a custom plugin page.

  1. In views.py, I have the ClusterTable being populated like so (which I basically copied off of other spots in the actual Netbox code):
cluster_table = ClusterTable(
    list(tenant.clusters.prefetch_related('group', 'site', 'devices', 'virtual_machines').all()),
    orderable=True,
)
cluster_table.columns.hide('type')
cluster_table.columns.hide('tenant')
cluster_table.columns.hide('device_count')
  1. In my plugin html file, I have the table being rendered via the responsive_table.html partial:
{% include 'responsive_table.html' with table=cluster_table %}

Expected Behavior

On page load, I expected to see the table to look something like this (sans the columns that I explicitly hid):
Screen Shot 2021-02-24 at 16 04 28

Observed Behavior

The VM count per cluster is 0
Screen Shot 2021-02-24 at 16 06 54

Originally created by @kuzmik on GitHub (Feb 24, 2021). ### Environment * Python version: Python 3.8.5 * NetBox version: 2.10.4 ### Steps to Reproduce I am using the `ClusterTable` object to display a list of Clusters owned by a Tenant in a custom plugin page. 1. In `views.py`, I have the ClusterTable being populated like so (which I basically copied off of other spots in the actual Netbox code): ``` cluster_table = ClusterTable( list(tenant.clusters.prefetch_related('group', 'site', 'devices', 'virtual_machines').all()), orderable=True, ) cluster_table.columns.hide('type') cluster_table.columns.hide('tenant') cluster_table.columns.hide('device_count') ``` 2. In my plugin html file, I have the table being rendered via the `responsive_table.html` partial: ``` {% include 'responsive_table.html' with table=cluster_table %} ``` <!-- What did you expect to happen? --> ### Expected Behavior On page load, I expected to see the table to look something like this (sans the columns that I explicitly hid): ![Screen Shot 2021-02-24 at 16 04 28](https://user-images.githubusercontent.com/4432296/109065843-2d3e8a00-76ba-11eb-9198-e33164d10c0c.png) <!-- What happened instead? --> ### Observed Behavior The VM count per cluster is 0 ![Screen Shot 2021-02-24 at 16 06 54](https://user-images.githubusercontent.com/4432296/109065948-595a0b00-76ba-11eb-8da2-b2b1fb73dc15.png)
adam closed this issue 2025-12-29 18:38:03 +01:00
Author
Owner

@DanSheps commented on GitHub (Feb 25, 2021):

Github issues is intended for bug reports and feature requests relating to the netbox core. Please take plugin development discussion/assistance to either Slack or GitHub Discussions instead.

@DanSheps commented on GitHub (Feb 25, 2021): Github issues is intended for bug reports and feature requests relating to the netbox core. Please take plugin development discussion/assistance to either Slack or [GitHub Discussions](https://github.com/netbox-community/netbox/discussions) instead.
Author
Owner

@kuzmik commented on GitHub (Feb 26, 2021):

Woops, my bad. Thought since I was using part of the netbox core it'd make sense to post this here. Thanks!

@kuzmik commented on GitHub (Feb 26, 2021): Woops, my bad. Thought since I was using part of the netbox core it'd make sense to post this here. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4591