2020-01-11 17:01:21 +01:00
|
|
|
import django_tables2 as tables
|
2020-08-03 16:49:45 +02:00
|
|
|
from django_tables2.utils import A
|
2020-01-11 17:01:21 +01:00
|
|
|
|
2020-02-23 12:58:39 +01:00
|
|
|
from core.tables import CoreTable
|
|
|
|
|
2020-01-11 17:01:21 +01:00
|
|
|
from .models import Backup
|
|
|
|
|
|
|
|
|
2020-02-23 12:58:39 +01:00
|
|
|
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
|
|
|
|
2020-02-23 12:58:39 +01:00
|
|
|
class Meta(CoreTable.Meta):
|
2020-01-11 17:01:21 +01:00
|
|
|
model = Backup
|