network_inventory/src/computers/tables.py

34 lines
866 B
Python
Raw Permalink Normal View History

2019-08-02 13:05:42 +02:00
import django_tables2 as tables
2020-08-03 16:35:10 +02:00
from django_tables2.utils import A
2019-08-02 13:05:42 +02:00
from core.tables import CoreTable
2019-12-11 17:52:50 +01:00
2020-02-29 21:05:18 +01:00
class ComputersTable(CoreTable):
2022-03-27 14:50:44 +02:00
name = tables.Column("Computer", linkify=True)
description = tables.Column(
2022-03-27 14:50:44 +02:00
attrs={"td": {"class": "text-truncate", "style": "max-width: 150px;"}}
)
2019-08-02 13:05:42 +02:00
serialnumber = tables.Column()
owner = tables.Column()
manufacturer = tables.Column()
model = tables.Column()
2019-08-02 13:05:42 +02:00
location = tables.Column()
2022-03-27 14:50:44 +02:00
user = tables.Column("User", linkify=True)
2019-08-02 13:05:42 +02:00
installation_date = tables.Column()
os = tables.Column()
2022-03-27 14:50:44 +02:00
delete = tables.LinkColumn(
"device_delete",
text="delete",
args=[A("pk")],
attrs={
"a": {
"class": "delete material-icons",
}
},
orderable=False,
)
2019-08-02 13:05:42 +02:00
class Meta(CoreTable.Meta):
pass