diff --git a/netbox/dcim/forms/filtersets.py b/netbox/dcim/forms/filtersets.py index 37b8afd17..4dbceb4f5 100644 --- a/netbox/dcim/forms/filtersets.py +++ b/netbox/dcim/forms/filtersets.py @@ -303,7 +303,7 @@ class RackTypeFilterForm(RackBaseFilterForm): model = RackType fieldsets = ( FieldSet('q', 'filter_id', 'tag'), - FieldSet('form_factor', 'width', 'u_height', name=_('Rack Type')), + FieldSet('manufacturer_id', 'form_factor', 'width', 'u_height', name=_('Rack Type')), FieldSet('starting_unit', 'desc_units', name=_('Numbering')), FieldSet('weight', 'max_weight', 'weight_unit', name=_('Weight')), ) diff --git a/netbox/dcim/tables/devicetypes.py b/netbox/dcim/tables/devicetypes.py index a7f8f08e8..91f9f3b47 100644 --- a/netbox/dcim/tables/devicetypes.py +++ b/netbox/dcim/tables/devicetypes.py @@ -31,6 +31,11 @@ class ManufacturerTable(ContactsColumnMixin, NetBoxTable): verbose_name=_('Name'), linkify=True ) + racktype_count = columns.LinkedCountColumn( + viewname='dcim:racktype_list', + url_params={'manufacturer_id': 'pk'}, + verbose_name=_('Rack Types') + ) devicetype_count = columns.LinkedCountColumn( viewname='dcim:devicetype_list', url_params={'manufacturer_id': 'pk'}, @@ -58,12 +63,12 @@ class ManufacturerTable(ContactsColumnMixin, NetBoxTable): class Meta(NetBoxTable.Meta): model = models.Manufacturer fields = ( - 'pk', 'id', 'name', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', 'platform_count', - 'description', 'slug', 'tags', 'contacts', 'actions', 'created', 'last_updated', + 'pk', 'id', 'name', 'racktype_count', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', + 'platform_count', 'description', 'slug', 'tags', 'contacts', 'actions', 'created', 'last_updated', ) default_columns = ( - 'pk', 'name', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', 'platform_count', - 'description', 'slug', + 'pk', 'name', 'racktype_count', 'devicetype_count', 'moduletype_count', 'inventoryitem_count', + 'platform_count', 'description', 'slug', ) diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index 6efdb63f0..583b89f1a 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -964,6 +964,7 @@ class RackReservationBulkDeleteView(generic.BulkDeleteView): @register_model_view(Manufacturer, 'list', path='', detail=False) class ManufacturerListView(generic.ObjectListView): queryset = Manufacturer.objects.annotate( + racktype_count=count_related(RackType, 'manufacturer'), devicetype_count=count_related(DeviceType, 'manufacturer'), moduletype_count=count_related(ModuleType, 'manufacturer'), inventoryitem_count=count_related(InventoryItem, 'manufacturer'),