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

#4416: Add individual & changelog views for InventoryItem

This commit is contained in:
Jeremy Stretch
2020-07-01 14:46:12 -04:00
parent 225b6c6958
commit 7e3e18faea
8 changed files with 155 additions and 94 deletions

View File

@ -775,6 +775,20 @@ class DeviceBayTable(DeviceComponentTable):
default_columns = ('pk', 'device', 'name', 'label', 'installed_device', 'description')
class InventoryItemTable(DeviceComponentTable):
manufacturer = tables.Column(
linkify=True
)
discovered = BooleanColumn()
class Meta(DeviceComponentTable.Meta):
model = InventoryItem
fields = (
'pk', 'device', 'name', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description', 'discovered'
)
default_columns = ('pk', 'device', 'name', 'manufacturer', 'part_id', 'serial', 'asset_tag')
#
# Cables
#
@ -917,29 +931,6 @@ class InterfaceConnectionTable(BaseTable):
)
#
# InventoryItems
#
class InventoryItemTable(BaseTable):
pk = ToggleColumn()
device = tables.LinkColumn(
viewname='dcim:device_inventory',
args=[Accessor('device.pk')]
)
manufacturer = tables.Column(
accessor=Accessor('manufacturer')
)
discovered = BooleanColumn()
class Meta(BaseTable.Meta):
model = InventoryItem
fields = (
'pk', 'device', 'name', 'manufacturer', 'part_id', 'serial', 'asset_tag', 'description', 'discovered'
)
default_columns = ('pk', 'device', 'name', 'manufacturer', 'part_id', 'serial', 'asset_tag')
#
# Virtual chassis
#