From 0f18515ad2553646f465e7cc0eb2847b518ea31b Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 6 Dec 2021 12:57:04 +0000 Subject: [PATCH] . --- atlas/tables.py | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/atlas/tables.py b/atlas/tables.py index b458d637..3b7c9297 100755 --- a/atlas/tables.py +++ b/atlas/tables.py @@ -79,8 +79,15 @@ class CaseTable(tables.Table): class Meta: model = Case template_name = "django_tables2/bootstrap4.html" - fields = ("title", "description", "history", "condition", "created_date", "author") - sequence = ("view", "series" ) + fields = ( + "title", + "description", + "history", + "condition", + "created_date", + "author", + ) + sequence = ("view", "series") class PopupLinkColumn(tables.Column): @@ -122,7 +129,14 @@ class SeriesTable(tables.Table): class Meta: model = Series template_name = "django_tables2/bootstrap4.html" - fields = ("modality","description", "examination", "plane", "contrast", "author") + fields = ( + "modality", + "description", + "examination", + "plane", + "contrast", + "author", + ) sequence = ("view", "popup", "images", "case") def render_popup(self, value, record): @@ -132,8 +146,12 @@ class SeriesTable(tables.Table): record.pk, ) + class ConditionTable(tables.Table): - name = tables.Column(linkify=('atlas:condition_detail', {'pk': tables.A('pk')}), verbose_name="Condition") + name = tables.Column( + linkify=("atlas:condition_detail", {"pk": tables.A("pk")}), + verbose_name="Condition", + ) edit = tables.LinkColumn( "atlas:condition_update", text="Edit", args=[A("pk")], orderable=False @@ -153,12 +171,14 @@ class ConditionTable(tables.Table): fields = ("primary", "subspecialty") sequence = ("name",) - def render_synonym2(self, value): - return value + def render_synonym2(self, value, record): + return f"{value}, {record.get_synonym()}" class FindingTable(tables.Table): - name = tables.Column(linkify=('atlas:finding_detail', {'pk': tables.A('pk')}), verbose_name="Finding") + name = tables.Column( + linkify=("atlas:finding_detail", {"pk": tables.A("pk")}), verbose_name="Finding" + ) edit = tables.LinkColumn( "atlas:finding_update", text="Edit", args=[A("pk")], orderable=False ) @@ -176,8 +196,12 @@ class FindingTable(tables.Table): fields = ("name", "primary") sequence = ("name",) + class StructureTable(tables.Table): - name = tables.Column(linkify=('atlas:structure_detail', {'pk': tables.A('pk')}), verbose_name="Structure") + name = tables.Column( + linkify=("atlas:structure_detail", {"pk": tables.A("pk")}), + verbose_name="Structure", + ) edit = tables.LinkColumn( "atlas:structure_update", text="Edit", args=[A("pk")], orderable=False ) @@ -193,4 +217,4 @@ class StructureTable(tables.Table): model = Structure template_name = "django_tables2/bootstrap4.html" fields = ("name", "primary") - sequence = ("name",) \ No newline at end of file + sequence = ("name",)