network_inventory/src/backups/tables.py

28 lines
680 B
Python
Raw Permalink 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)
2022-03-27 14:50:44 +02:00
name = tables.Column("Backup", linkify=True)
computer = tables.Column("Computer", linkify=True)
2020-01-11 17:01:21 +01:00
target_device = tables.ManyToManyColumn(linkify_item=True)
2022-03-27 14:50:44 +02:00
delete = tables.LinkColumn(
"backup_delete_from-table",
text="delete",
args=[A("pk")],
attrs={
"a": {
"class": "delete material-icons",
}
},
orderable=False,
)
2020-01-11 17:01:21 +01:00
class Meta(CoreTable.Meta):
2020-01-11 17:01:21 +01:00
model = Backup