summaryrefslogtreecommitdiff
path: root/app/media
diff options
context:
space:
mode:
Diffstat (limited to 'app/media')
-rw-r--r--app/media/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/media/models.py b/app/media/models.py
index 2fc669a..b67699b 100644
--- a/app/media/models.py
+++ b/app/media/models.py
@@ -146,6 +146,8 @@ class LuxImage(models.Model):
def get_image_url_by_size(self, size="original"):
if size == "original":
return self.image.url
+ if size == "admin_insert":
+ return "images/%s/%s.%s" % (self.pub_date.strftime("%Y"), self.image_name, self.image_ext)
else:
luximagesize = LuxImageSize.objects.get(slug=size)
#if luximagesize not in self.get_sizes:
@@ -304,6 +306,9 @@ class LuxAudio(models.Model):
def get_absolute_url(self):
return reverse("prompt:detail", kwargs={"slug": self.slug})
+ def get_image_url_by_size(self, size="original"):
+ pass
+
@property
def get_previous_published(self):
return self.get_previous_by_pub_date(status__exact=1)