-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apis_history): adds table for viewing apis history records
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
2 changes: 2 additions & 0 deletions
2
apis_core/apis_history/templates/apis_history/columns/description.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |