This commit is contained in:
Ross
2021-12-07 11:58:35 +00:00
parent 9ed3e765e1
commit c858e95d7c
6 changed files with 163 additions and 35 deletions
+47 -2
View File
@@ -1,7 +1,7 @@
import django_tables2 as tables
from django_tables2.utils import A
from .models import Case, Condition, Series, Structure, Finding
from .models import Case, Condition, PathalogicalProcess, Presentation, Series, Structure, Finding
from django.utils.html import format_html
@@ -225,4 +225,49 @@ class StructureTable(tables.Table):
sequence = ("name",)
def render_synonym(self, value, record):
return format_html(record.get_synonym_link())
return format_html(record.get_synonym_link())
class PresentationTable(tables.Table):
name = tables.Column(
linkify=("atlas:condition_detail", {"pk": tables.A("pk")}),
verbose_name="Presentation",
)
edit = tables.LinkColumn(
"atlas:condition_update", text="Edit", args=[A("pk")], orderable=False
)
delete = tables.LinkColumn(
"atlas:condition_delete", text="Delete", args=[A("pk")], orderable=False
)
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
subspecialty = tables.ManyToManyColumn(verbose_name="Parents")
class Meta:
model = Presentation
template_name = "django_tables2/bootstrap4.html"
fields = ()
sequence = ("name",)
class PathologicalProcessTable(tables.Table):
name = tables.Column(
linkify=("atlas:condition_detail", {"pk": tables.A("pk")}),
verbose_name="PathologicalProcess",
)
edit = tables.LinkColumn(
"atlas:condition_update", text="Edit", args=[A("pk")], orderable=False
)
delete = tables.LinkColumn(
"atlas:condition_delete", text="Delete", args=[A("pk")], orderable=False
)
selection = tables.CheckBoxColumn(accessor="pk", orderable=False)
subspecialty = tables.ManyToManyColumn(verbose_name="Parents")
class Meta:
model = PathalogicalProcess
template_name = "django_tables2/bootstrap4.html"
fields = ()
sequence = ("name",)