Skip to content

Commit

Permalink
feat(apis_history): adds table for viewing apis history records
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Mar 5, 2024
1 parent c0c0911 commit 3b17130
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apis_core/apis_history/tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from apis_core.generic.tables import CustomTemplateColumn, ViewColumn
import django_tables2 as tables


class DescriptionColumnHistory(CustomTemplateColumn):
"""
A column showing a model description
"""

template_name = "apis_history/columns/description.html"
orderable = False


class APISHistoryTableBaseTable(tables.Table):
history_id = tables.Column(verbose_name="ID")
desc = DescriptionColumnHistory()
view = ViewColumn()

class Meta:
fields = ["history_id", "desc", "view"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% load apisgeneric %}
<a href="{% url 'apis_core:generic:detail' record|contenttype record.history_id %}">{{ record }}</a>

0 comments on commit 3b17130

Please sign in to comment.