Repository: netbox-community/netbox
Pull request: 16252 only show results count if paginator
### Fixes: #16252 



Problem statement:
Elevations results count span contains a dot instead of a number
### Deployment Type

Self-hosted

### NetBox Version

v4.0.2

### Python Version

3.10

### Steps to Reproduce

0. Start with a fresh, empty install
1. Navigate to Organization -> Elevations
2. Note appearance of the Results tab
3. Create a site
4. Create a rack
5. Navigate again to Organization -> Elevations
6. Note again the appearance of the Results tab

### Expected Behavior

The Results tab should hava a badge containing a number: either `0` in step 2 or `1` in step 6

### Observed Behavior

The Results tab is badged with a dot. Upon inspecting the document, the `<span>` element in question is completely empty.

Hints from issue discussion:

Commit message: 16252 hack in table page count

Patch to review:
diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py
index 67099523105..4b4c450e4d9 100644
--- a/netbox/dcim/views.py
+++ b/netbox/dcim/views.py
@@ -651,6 +651,7 @@ def get(self, request):
             'rack_face': rack_face,
             'filter_form': forms.RackElevationFilterForm(request.GET),
             'model': self.queryset.model,
+            'table': {'page': page},  # hack to show count in Result tab
         })
 
 


Code review comments:
diff_hunk: @@ -651,6 +651,7 @@ def get(self, request):
             'rack_face': rack_face,
             'filter_form': forms.RackElevationFilterForm(request.GET),
             'model': self.queryset.model,
+            'table': {'page': page},  # hack to show count in Result tab
path: netbox/dcim/views.py
text: @user1:
We can do better than this. Instead of directly referencing a table object in the template, we can check for e.g. `object_count` (which will be passed by RackElevationListView) and default to the table paginator count if not set.