network_inventory/backend/backups/tables.py

22 lines
712 B
Python
Raw Normal View History

2020-01-11 17:01:21 +01:00
import django_tables2 as tables
from django_tables2.utils import A
2020-01-11 17:01:21 +01:00
from core.tables import CoreTable
2020-01-11 17:01:21 +01:00
from .models import Backup
class BackupsTable(CoreTable):
2020-01-11 17:01:21 +01:00
id = tables.Column(visible=False)
name = tables.Column('Backup', linkify=True)
computer = tables.Column('Computer', linkify=True)
target_device = tables.ManyToManyColumn(linkify_item=True)
delete = tables.LinkColumn('backup_delete_from-table',
text='delete',
args=[A('pk')], attrs={
'a': {'class': 'delete material-icons', }
2020-08-03 17:37:08 +02:00
}, orderable=False)
2020-01-11 17:01:21 +01:00
class Meta(CoreTable.Meta):
2020-01-11 17:01:21 +01:00
model = Backup