diff options
Diffstat (limited to 'app/media')
-rw-r--r-- | app/media/models.py | 3 |
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") |