From c867649c24f49eec58635f799bfdf178fb0f148a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Schl=C3=B6gl?= Date: Tue, 5 Mar 2024 17:46:09 +0100 Subject: [PATCH] fix: adds link to original object; uses triple filterset --- apis_core/apis_history/tables.py | 10 ++++++++++ .../templates/apis_history/columns/original_id.html | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 apis_core/apis_history/templates/apis_history/columns/original_id.html diff --git a/apis_core/apis_history/tables.py b/apis_core/apis_history/tables.py index d8ff44dd6..bbe607e32 100644 --- a/apis_core/apis_history/tables.py +++ b/apis_core/apis_history/tables.py @@ -11,8 +11,18 @@ class DescriptionColumnHistory(CustomTemplateColumn): orderable = False +class OriginalIDColumn(CustomTemplateColumn): + """ + A column showing the original id of a model instance + """ + + template_name = "apis_history/columns/original_id.html" + orderable = False + + class APISHistoryTableBaseTable(tables.Table): history_id = tables.Column(verbose_name="ID") + orig_id = OriginalIDColumn() desc = DescriptionColumnHistory() view = ViewColumn() diff --git a/apis_core/apis_history/templates/apis_history/columns/original_id.html b/apis_core/apis_history/templates/apis_history/columns/original_id.html new file mode 100644 index 000000000..c36219078 --- /dev/null +++ b/apis_core/apis_history/templates/apis_history/columns/original_id.html @@ -0,0 +1,2 @@ +{% load apisgeneric %} +{{ record.id }} \ No newline at end of file