This commit is contained in:
Ross
2021-12-07 11:59:50 +00:00
parent c858e95d7c
commit 477b53a86f
+11 -3
View File
@@ -1,7 +1,15 @@
import django_tables2 as tables
from django_tables2.utils import A
from .models import Case, Condition, PathalogicalProcess, Presentation, Series, Structure, Finding
from .models import (
Case,
Condition,
PathalogicalProcess,
Presentation,
Series,
Structure,
Finding,
)
from django.utils.html import format_html
@@ -201,6 +209,7 @@ class FindingTable(tables.Table):
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
class StructureTable(tables.Table):
name = tables.Column(
linkify=("atlas:structure_detail", {"pk": tables.A("pk")}),
@@ -227,6 +236,7 @@ class StructureTable(tables.Table):
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
class PresentationTable(tables.Table):
name = tables.Column(
linkify=("atlas:condition_detail", {"pk": tables.A("pk")}),
@@ -264,8 +274,6 @@ class PathologicalProcessTable(tables.Table):
)
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
subspecialty = tables.ManyToManyColumn(verbose_name="Parents")
class Meta:
model = PathalogicalProcess
template_name = "django_tables2/bootstrap4.html"