summaryrefslogtreecommitdiff
path: root/app/media/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-12-02 15:02:12 -0500
committerluxagraf <sng@luxagraf.net>2020-12-02 15:02:12 -0500
commitab8055b5cab2523d925f59c65bc38df103a26991 (patch)
tree29e4597bc0d86d658f574c0c4f0b036351a68742 /app/media/models.py
parent87f692178a6e30719c564076f00c206642f36ce6 (diff)
deleted old apps and media
Diffstat (limited to 'app/media/models.py')
-rw-r--r--app/media/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/media/models.py b/app/media/models.py
index bc27758..2fc669a 100644
--- a/app/media/models.py
+++ b/app/media/models.py
@@ -147,7 +147,7 @@ class LuxImage(models.Model):
if size == "original":
return self.image.url
else:
- luximagesize = LuxImageSize.objects.get(name=size)
+ luximagesize = LuxImageSize.objects.get(slug=size)
#if luximagesize not in self.get_sizes:
#self.sizes.add(luximagesize)
return "%s%s/%s_%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), self.image_name, luximagesize.slug, self.image_ext)
@@ -159,6 +159,7 @@ class LuxImage(models.Model):
luximagesize = LuxImageSize.objects.get(slug=size)
return "%s%s/%s_%s.%s" % (settings.IMAGES_ROOT, self.pub_date.strftime("%Y"), self.image_name, luximagesize.slug, self.image_ext)
+ @cached_property
def get_thumbnail_url(self):
return self.get_image_url_by_size("tn")