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:
@@ -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
|
||||
|
Reference in New Issue
Block a user