From fec98db1b84a21eab99b87a5e60cadb2d1f79ae3 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 3 Aug 2020 16:35:10 +0200 Subject: [PATCH] add delete button to computers table --- computers/tables.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/computers/tables.py b/computers/tables.py index d6f41be..7c3966c 100644 --- a/computers/tables.py +++ b/computers/tables.py @@ -1,4 +1,5 @@ import django_tables2 as tables +from django_tables2.utils import A from core.tables import CoreTable @@ -14,6 +15,11 @@ class ComputersTable(CoreTable): user = tables.Column('User', linkify=True) installation_date = tables.Column() os = tables.Column() + delete = tables.LinkColumn('device_delete', + text='delete', + args=[A('pk')], attrs={ + 'a': {'class': 'delete material-icons', } + }) class Meta(CoreTable.Meta): pass