.
This commit is contained in:
+6
-3
@@ -102,6 +102,9 @@ class SynMixin(object):
|
||||
syns = self.synonym.filter(primary=True)
|
||||
return ", ".join([f"<a href='{s.get_absolute_url()}'>{s.name}</a>" for s in syns])
|
||||
|
||||
def get_link(self):
|
||||
format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name)
|
||||
|
||||
|
||||
class Finding(SynMixin, models.Model):
|
||||
name = models.CharField(max_length=255, unique=True)
|
||||
@@ -125,9 +128,6 @@ class Condition(SynMixin, models.Model):
|
||||
def get_absolute_url(self):
|
||||
return reverse("atlas:condition_detail", kwargs={"pk": self.pk})
|
||||
|
||||
def get_link(self):
|
||||
format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self.name)
|
||||
|
||||
class Subspecialty(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
@@ -230,6 +230,9 @@ class Case(models.Model):
|
||||
authors = [i for i in self.author.all()]
|
||||
return authors
|
||||
|
||||
def get_link(self):
|
||||
format_html("<a href='{}'>{}</a>", self.get_absolute_url(), self)
|
||||
|
||||
def __str__(self):
|
||||
examinations = [series.get_examination() for series in self.series.all()]
|
||||
return "{}/{} : {}".format(self.pk, self.description, ", ".join(examinations))
|
||||
|
||||
Reference in New Issue
Block a user