diff --git a/atlas/models.py b/atlas/models.py index 101be82f..cee29708 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -30,7 +30,7 @@ from anatomy.models import Modality from generic.models import ( Examination, - #Condition, + # Condition, Sign, ExamBase, Plane, @@ -55,14 +55,14 @@ from django.contrib.contenttypes.fields import GenericRelation image_storage = FileSystemStorage( # Physical file location ROOT - location=u"{0}atlas/".format(settings.MEDIA_ROOT), + location="{0}atlas/".format(settings.MEDIA_ROOT), # Url for file - base_url=u"{0}atlas/".format(settings.MEDIA_URL), + base_url="{0}atlas/".format(settings.MEDIA_URL), ) def image_directory_path(instance, filename): - return u"atlas/picture/{0}".format(filename) + return "atlas/picture/{0}".format(filename) def findMiddle(input_list): @@ -80,7 +80,11 @@ class Condition(models.Model): synonym = models.ManyToManyField("self", blank=True) def __str__(self) -> str: - return self.name + if self.synonym.objects.count() == 0: + return self.name + else: + synonyms = ",".join(self.synonym.objects.all()) + return f"{self.name} ({synonyms})" @reversion.register