From ab8055b5cab2523d925f59c65bc38df103a26991 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 2 Dec 2020 15:02:12 -0500 Subject: deleted old apps and media --- app/media/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/media') 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") -- cgit v1.2.3-70-g09d2