Region table does not show count of Sites #9049
-
Hi All, In Region table the count of Sites shown for each region is 0 and while click on the region name details of region are shown with correct count of Sites. Any idea of what can be the cause of the issue ? Thanks & Regards, Hamid Allaoui |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I'm missing the "Parent" row between "Description" and "Sites". Are you using an old version of netbox? |
Beta Was this translation helpful? Give feedback.
-
I removed it from the view because I have a customized region without parent. For info I am using netbox-3.1.8. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi All, Any idea please on that issue ? Thanks & Regards, Hamid Allaoui |
Beta Was this translation helpful? Give feedback.
-
Hi All, My issue has been fixed. Actually I created new app with custom region (IamsRegion) and custom site (IamsSite) and in views.py file I created IamsRegionListView as: class IamsRegionListView(generic.ObjectListView): while it should be: class IamsRegionListView(generic.ObjectListView): Thanks & Regards, Hamid Allaoui |
Beta Was this translation helpful? Give feedback.
Hi All,
My issue has been fixed.
Actually I created new app with custom region (IamsRegion) and custom site (IamsSite) and in views.py file I created IamsRegionListView as:
class IamsRegionListView(generic.ObjectListView):
queryset = IamsRegion.objects.all()
filterset = filtersets.IamsRegionFilterSet
filterset_form = forms.IamsRegionFilterForm
table = tables.IamsRegionTable
while it should be:
class IamsRegionListView(generic.ObjectListView):
queryset = IamsRegion.objects.add_related_count(
IamsRegion.objects.all(),
IamsSite,
'region',
'site_count',
cumulative=True
)
filterset = filtersets.IamsRegionFilterSet
filterset_form = forms.IamsRegionFilterForm
table = tables.IamsRegionTable
Thank…