mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Closes #3151: Add inventory item count to manufacturers list
This commit is contained in:
parent
823257ca72
commit
a6ff6505c6
@ -5,6 +5,7 @@
|
|||||||
* [#2813](https://github.com/digitalocean/netbox/issues/2813) - Add tenant group filters
|
* [#2813](https://github.com/digitalocean/netbox/issues/2813) - Add tenant group filters
|
||||||
* [#3085](https://github.com/digitalocean/netbox/issues/3085) - Catch all exceptions during export template rendering
|
* [#3085](https://github.com/digitalocean/netbox/issues/3085) - Catch all exceptions during export template rendering
|
||||||
* [#3138](https://github.com/digitalocean/netbox/issues/3138) - Add 2.5GE and 5GE interface form factors
|
* [#3138](https://github.com/digitalocean/netbox/issues/3138) - Add 2.5GE and 5GE interface form factors
|
||||||
|
* [#3151](https://github.com/digitalocean/netbox/issues/3151) - Add inventory item count to manufacturers list
|
||||||
* [#3156](https://github.com/digitalocean/netbox/issues/3156) - Add site link to rack reservations overview
|
* [#3156](https://github.com/digitalocean/netbox/issues/3156) - Add site link to rack reservations overview
|
||||||
* [#3183](https://github.com/digitalocean/netbox/issues/3183) - Enable bulk deletion of sites
|
* [#3183](https://github.com/digitalocean/netbox/issues/3183) - Enable bulk deletion of sites
|
||||||
* [#3185](https://github.com/digitalocean/netbox/issues/3185) - Improve performance for custom field access within templates
|
* [#3185](https://github.com/digitalocean/netbox/issues/3185) - Improve performance for custom field access within templates
|
||||||
|
@ -328,16 +328,26 @@ class RackReservationTable(BaseTable):
|
|||||||
|
|
||||||
class ManufacturerTable(BaseTable):
|
class ManufacturerTable(BaseTable):
|
||||||
pk = ToggleColumn()
|
pk = ToggleColumn()
|
||||||
name = tables.LinkColumn(verbose_name='Name')
|
name = tables.LinkColumn()
|
||||||
devicetype_count = tables.Column(verbose_name='Device Types')
|
devicetype_count = tables.Column(
|
||||||
platform_count = tables.Column(verbose_name='Platforms')
|
verbose_name='Device Types'
|
||||||
slug = tables.Column(verbose_name='Slug')
|
)
|
||||||
actions = tables.TemplateColumn(template_code=MANUFACTURER_ACTIONS, attrs={'td': {'class': 'text-right noprint'}},
|
inventoryitem_count = tables.Column(
|
||||||
verbose_name='')
|
verbose_name='Inventory Items'
|
||||||
|
)
|
||||||
|
platform_count = tables.Column(
|
||||||
|
verbose_name='Platforms'
|
||||||
|
)
|
||||||
|
slug = tables.Column()
|
||||||
|
actions = tables.TemplateColumn(
|
||||||
|
template_code=MANUFACTURER_ACTIONS,
|
||||||
|
attrs={'td': {'class': 'text-right noprint'}},
|
||||||
|
verbose_name=''
|
||||||
|
)
|
||||||
|
|
||||||
class Meta(BaseTable.Meta):
|
class Meta(BaseTable.Meta):
|
||||||
model = Manufacturer
|
model = Manufacturer
|
||||||
fields = ('pk', 'name', 'devicetype_count', 'platform_count', 'slug', 'actions')
|
fields = ('pk', 'name', 'devicetype_count', 'inventoryitem_count', 'platform_count', 'slug', 'actions')
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -516,6 +516,7 @@ class RackReservationBulkDeleteView(PermissionRequiredMixin, BulkDeleteView):
|
|||||||
class ManufacturerListView(ObjectListView):
|
class ManufacturerListView(ObjectListView):
|
||||||
queryset = Manufacturer.objects.annotate(
|
queryset = Manufacturer.objects.annotate(
|
||||||
devicetype_count=Count('device_types', distinct=True),
|
devicetype_count=Count('device_types', distinct=True),
|
||||||
|
inventoryitem_count=Count('inventory_items', distinct=True),
|
||||||
platform_count=Count('platforms', distinct=True),
|
platform_count=Count('platforms', distinct=True),
|
||||||
)
|
)
|
||||||
table = tables.ManufacturerTable
|
table = tables.ManufacturerTable
|
||||||
|
Loading…
Reference in New Issue
Block a user