This commit is contained in:
Ross
2021-11-25 22:27:41 +00:00
parent b4f882882d
commit e42bd345ca
+7 -3
View File
@@ -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:
if self.synonym.objects.count() == 0:
return self.name
else:
synonyms = ",".join(self.synonym.objects.all())
return f"{self.name} ({synonyms})"
@reversion.register