.
This commit is contained in:
+7
-10
@@ -115,17 +115,9 @@ class Long(models.Model):
|
|||||||
authors = ", ".join([i.username for i in self.author.all()])
|
authors = ", ".join([i.username for i in self.author.all()])
|
||||||
return authors
|
return authors
|
||||||
|
|
||||||
def get_examinations(self):
|
|
||||||
"""Returns a comma seperated text list of regions"""
|
|
||||||
examinations = ", ".join([i.examination for i in self.examination.all()])
|
|
||||||
return examinations
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
exams = self.get_examinations()
|
examinations = [series.get_examinations() for series in self.series]
|
||||||
lat = ""
|
return "{} : {}".format(self.history, ", ".join(examinations))
|
||||||
if self.laterality != "NONE":
|
|
||||||
lat = self.laterality
|
|
||||||
return "{} / {} {}".format(exams, lat, n)
|
|
||||||
|
|
||||||
def GetExams(self):
|
def GetExams(self):
|
||||||
e = self.exams.all().values_list("name", flat=True)
|
e = self.exams.all().values_list("name", flat=True)
|
||||||
@@ -160,6 +152,11 @@ class LongSeries(models.Model):
|
|||||||
long = models.ForeignKey("Long", related_name="long", on_delete=models.SET_NULL, null=True)
|
long = models.ForeignKey("Long", related_name="long", on_delete=models.SET_NULL, null=True)
|
||||||
description = models.TextField(blank=True, help_text="Description of stack, for admin organisation")
|
description = models.TextField(blank=True, help_text="Description of stack, for admin organisation")
|
||||||
|
|
||||||
|
def get_examinations(self):
|
||||||
|
"""Returns a comma seperated text list of regions"""
|
||||||
|
examinations = ", ".join([i.examination for i in self.examination.all()])
|
||||||
|
return examinations
|
||||||
|
|
||||||
#class LongImage(models.Model):
|
#class LongImage(models.Model):
|
||||||
# long = models.ForeignKey(Long,
|
# long = models.ForeignKey(Long,
|
||||||
# related_name="images",
|
# related_name="images",
|
||||||
|
|||||||
Reference in New Issue
Block a user