mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Closes #11554: Add module types count to manufacturers list
This commit is contained in:
parent
9cb75e9834
commit
22a9df82e6
@ -5,6 +5,7 @@
|
|||||||
### Enhancements
|
### Enhancements
|
||||||
|
|
||||||
* [#10762](https://github.com/netbox-community/netbox/issues/10762) - Permit selection custom fields to have only one choice
|
* [#10762](https://github.com/netbox-community/netbox/issues/10762) - Permit selection custom fields to have only one choice
|
||||||
|
* [#11554](https://github.com/netbox-community/netbox/issues/11554) - Add module types count to manufacturers list
|
||||||
* [#11585](https://github.com/netbox-community/netbox/issues/11585) - Add IP address filters for services
|
* [#11585](https://github.com/netbox-community/netbox/issues/11585) - Add IP address filters for services
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
@ -34,10 +34,19 @@ class ManufacturerTable(ContactsColumnMixin, NetBoxTable):
|
|||||||
url_params={'manufacturer_id': 'pk'},
|
url_params={'manufacturer_id': 'pk'},
|
||||||
verbose_name='Device Types'
|
verbose_name='Device Types'
|
||||||
)
|
)
|
||||||
inventoryitem_count = tables.Column(
|
moduletype_count = columns.LinkedCountColumn(
|
||||||
|
viewname='dcim:moduletype_list',
|
||||||
|
url_params={'manufacturer_id': 'pk'},
|
||||||
|
verbose_name='Module Types'
|
||||||
|
)
|
||||||
|
inventoryitem_count = columns.LinkedCountColumn(
|
||||||
|
viewname='dcim:inventoryitem_list',
|
||||||
|
url_params={'manufacturer_id': 'pk'},
|
||||||
verbose_name='Inventory Items'
|
verbose_name='Inventory Items'
|
||||||
)
|
)
|
||||||
platform_count = tables.Column(
|
platform_count = columns.LinkedCountColumn(
|
||||||
|
viewname='dcim:platform_list',
|
||||||
|
url_params={'manufacturer_id': 'pk'},
|
||||||
verbose_name='Platforms'
|
verbose_name='Platforms'
|
||||||
)
|
)
|
||||||
slug = tables.Column()
|
slug = tables.Column()
|
||||||
@ -48,11 +57,12 @@ class ManufacturerTable(ContactsColumnMixin, NetBoxTable):
|
|||||||
class Meta(NetBoxTable.Meta):
|
class Meta(NetBoxTable.Meta):
|
||||||
model = models.Manufacturer
|
model = models.Manufacturer
|
||||||
fields = (
|
fields = (
|
||||||
'pk', 'id', 'name', 'devicetype_count', 'inventoryitem_count', 'platform_count', 'description', 'slug',
|
'pk', 'id', 'name', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', 'platform_count',
|
||||||
'tags', 'contacts', 'actions', 'created', 'last_updated',
|
'description', 'slug', 'tags', 'contacts', 'actions', 'created', 'last_updated',
|
||||||
)
|
)
|
||||||
default_columns = (
|
default_columns = (
|
||||||
'pk', 'name', 'devicetype_count', 'inventoryitem_count', 'platform_count', 'description', 'slug',
|
'pk', 'name', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', 'platform_count',
|
||||||
|
'description', 'slug',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -842,6 +842,7 @@ class RackReservationBulkDeleteView(generic.BulkDeleteView):
|
|||||||
class ManufacturerListView(generic.ObjectListView):
|
class ManufacturerListView(generic.ObjectListView):
|
||||||
queryset = Manufacturer.objects.annotate(
|
queryset = Manufacturer.objects.annotate(
|
||||||
devicetype_count=count_related(DeviceType, 'manufacturer'),
|
devicetype_count=count_related(DeviceType, 'manufacturer'),
|
||||||
|
moduletype_count=count_related(ModuleType, 'manufacturer'),
|
||||||
inventoryitem_count=count_related(InventoryItem, 'manufacturer'),
|
inventoryitem_count=count_related(InventoryItem, 'manufacturer'),
|
||||||
platform_count=count_related(Platform, 'manufacturer')
|
platform_count=count_related(Platform, 'manufacturer')
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user