From 8a1871a7b3a2472c661ddb9ce037a614cb48742f Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 12 Mar 2024 18:37:01 +0100 Subject: [PATCH] delete file datas --- idhub/admin/tables.py | 9 ++++++++- idhub/admin/views.py | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/idhub/admin/tables.py b/idhub/admin/tables.py index 51df7e8..6e6b273 100644 --- a/idhub/admin/tables.py +++ b/idhub/admin/tables.py @@ -211,11 +211,18 @@ class DIDTable(tables.Table): class DataTable(tables.Table): created_at = tables.Column(verbose_name="Date") file_name = tables.Column(verbose_name="File") + delete_template_code = """""" + delete_data = tables.TemplateColumn(template_code=delete_template_code, + orderable=False, + verbose_name="Delete") class Meta: model = File_datas template_name = "idhub/custom_table.html" - fields = ("created_at", "file_name", "success") + fields = ("created_at", "file_name", "success", "delete_data") class TemplateTable(tables.Table): diff --git a/idhub/admin/views.py b/idhub/admin/views.py index aed49ba..e8e4876 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -1080,8 +1080,8 @@ class ImportAddView(NotifyActivateUserByEmail, ImportExport, FormView): return super().form_valid(form) -class ImportDeleteView(AdminView): - model = PeopleView +class ImportDeleteView(AdminView, DeleteView): + model = File_datas def get(self, request, *args, **kwargs): self.check_valid_user()