This commit is contained in:
Ross
2021-12-07 11:45:40 +00:00
parent 1296737e19
commit c18beedaa7
+10 -2
View File
@@ -130,6 +130,7 @@ class Condition(SynMixin, models.Model):
def get_absolute_url(self):
return reverse("atlas:condition_detail", kwargs={"pk": self.pk})
class Presentation(SynMixin, models.Model):
name = models.CharField(max_length=255)
@@ -137,12 +138,15 @@ class Presentation(SynMixin, models.Model):
def __str__(self) -> str:
if self.subspecialty:
return f"{self.name} ({', '.join([i for i in self.subspecialty.all()])})"
return (
f"{self.name} ({', '.join([str(i) for i in self.subspecialty.all()])})"
)
return self.name
def get_absolute_url(self):
return reverse("atlas:presentation_detail", kwargs={"pk": self.pk})
class Subspecialty(models.Model):
name = models.CharField(max_length=255)
@@ -152,6 +156,7 @@ class Subspecialty(models.Model):
def get_absolute_url(self):
return reverse("atlas:subspecialty_detail", kwargs={"pk": self.pk})
class PathalogicalProcess(models.Model):
name = models.CharField(max_length=255)
@@ -161,6 +166,7 @@ class PathalogicalProcess(models.Model):
def get_absolute_url(self):
return reverse("atlas:pathalogical_process_detail", kwargs={"pk": self.pk})
class Differential(models.Model):
condition = models.ForeignKey(Condition, on_delete=models.CASCADE)
case = models.ForeignKey(
@@ -428,7 +434,9 @@ class Series(models.Model):
return format_html('<img src="/media/{}" />', thumbnail), len(images)
def get_thumbnail_link(self):
return format_html("<a href='{}'>{}<a/>", self.get_absolute_url(), self.get_thumbnail()[0])
return format_html(
"<a href='{}'>{}<a/>", self.get_absolute_url(), self.get_thumbnail()[0]
)
def get_block(self):
examination = self.get_examination_full()