network_inventory/computers/tables.py

32 lines
953 B
Python
Raw 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):
2019-12-30 00:19:24 +01:00
name = tables.Column('Computer', linkify=True)
description = tables.Column(
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()
user = tables.Column('User', linkify=True)
2019-08-02 13:05:42 +02:00
installation_date = tables.Column()
os = tables.Column()
2020-08-03 16:35:10 +02:00
delete = tables.LinkColumn('device_delete',
text='delete',
args=[A('pk')], attrs={
'a': {'class': 'delete material-icons', }
2020-08-03 17:37:08 +02:00
}, orderable=False)
2019-08-02 13:05:42 +02:00
class Meta(CoreTable.Meta):
pass