diff options
author | luxagraf <sng@luxagraf.net> | 2016-11-18 08:25:22 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-11-18 08:25:22 -0500 |
commit | 99a23d820bc0abd93aa55ab53f0c8f1a5598175f (patch) | |
tree | 2ec4038639924619782f4bfeccf6a8f05dc3849c /app/photos | |
parent | 367ca2fa4682d26507f56a91f93baa7680764b93 (diff) |
photo parser now creates size if it doesn't exist and picwide within
image clusters gets responsive images
Diffstat (limited to 'app/photos')
-rw-r--r-- | app/photos/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/photos/models.py b/app/photos/models.py index ac85a50..4249e6f 100644 --- a/app/photos/models.py +++ b/app/photos/models.py @@ -113,6 +113,11 @@ class LuxImage(models.Model): if size == "original": return "%soriginal/%s/%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, self.get_image_ext()) else: + if size != 'tn': + s = LuxImageSize.objects.get(name=size) + if s not in self.sizes.all(): + print("new size is "+s.name) + self.sizes.add(s) return "%s%s/%s_%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, size, self.get_image_ext()) def get_image_path_by_size(self, size="original"): |