From 52069d457733a25de968e3b7a18027d4fdf6b3ad Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 6 Dec 2021 12:52:45 +0000 Subject: [PATCH] . --- atlas/models.py | 7 +++++++ atlas/tables.py | 1 + 2 files changed, 8 insertions(+) diff --git a/atlas/models.py b/atlas/models.py index 3d059cde..ea7ae9f1 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -88,6 +88,13 @@ class SynMixin(object): else: return f"{self.name} [syn]" + def get_synonym(self): + if self.primary: + return "[Primary]" + else: + s = self.synonym.filter(primary=True) + return ", ".join(s) + class Finding(SynMixin, models.Model): name = models.CharField(max_length=255, unique=True) diff --git a/atlas/tables.py b/atlas/tables.py index a06cbf0f..322856bd 100755 --- a/atlas/tables.py +++ b/atlas/tables.py @@ -144,6 +144,7 @@ class ConditionTable(tables.Table): selection = tables.CheckBoxColumn(accessor="pk", orderable=False) synonym = tables.ManyToManyColumn(verbose_name="Synonyms") + synonym2 = tables.Column(attrs=[A("pk")]) parent = tables.ManyToManyColumn(verbose_name="Parents") class Meta: