.
This commit is contained in:
+9
-5
@@ -30,7 +30,7 @@ from anatomy.models import Modality
|
|||||||
|
|
||||||
from generic.models import (
|
from generic.models import (
|
||||||
Examination,
|
Examination,
|
||||||
#Condition,
|
# Condition,
|
||||||
Sign,
|
Sign,
|
||||||
ExamBase,
|
ExamBase,
|
||||||
Plane,
|
Plane,
|
||||||
@@ -55,14 +55,14 @@ from django.contrib.contenttypes.fields import GenericRelation
|
|||||||
|
|
||||||
image_storage = FileSystemStorage(
|
image_storage = FileSystemStorage(
|
||||||
# Physical file location ROOT
|
# Physical file location ROOT
|
||||||
location=u"{0}atlas/".format(settings.MEDIA_ROOT),
|
location="{0}atlas/".format(settings.MEDIA_ROOT),
|
||||||
# Url for file
|
# 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):
|
def image_directory_path(instance, filename):
|
||||||
return u"atlas/picture/{0}".format(filename)
|
return "atlas/picture/{0}".format(filename)
|
||||||
|
|
||||||
|
|
||||||
def findMiddle(input_list):
|
def findMiddle(input_list):
|
||||||
@@ -80,7 +80,11 @@ class Condition(models.Model):
|
|||||||
synonym = models.ManyToManyField("self", blank=True)
|
synonym = models.ManyToManyField("self", blank=True)
|
||||||
|
|
||||||
def __str__(self) -> str:
|
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
|
@reversion.register
|
||||||
|
|||||||
Reference in New Issue
Block a user