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

Fixes #6433: Fix bulk editing of child prefixes under aggregate view

This commit is contained in:
jeremystretch
2021-10-01 16:21:16 -04:00
parent 376c776520
commit 1be748b479
5 changed files with 16 additions and 4 deletions

View File

@@ -111,6 +111,16 @@ class BaseTable(tables.Table):
def selected_columns(self):
return self._get_columns(visible=True)
@property
def objects_count(self):
"""
Return the total number of real objects represented by the Table. This is useful when dealing with
prefixes/IP addresses/etc., where some table rows may represent available address space.
"""
if not hasattr(self, '_objects_count'):
self._objects_count = sum(1 for obj in self.data if getattr(obj, 'pk'))
return self._objects_count
#
# Table columns