diff options
author | luxagraf <sng@luxagraf.net> | 2020-12-02 16:13:45 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-12-02 16:13:45 -0500 |
commit | 6153850da86c3158ad86b3a3bf1593c396e46b03 (patch) | |
tree | 67a289466b03c5e4093dd098fc06561f520a3d2e /app | |
parent | 32c4a9dbeb374e93188755da7f406ddfd16f7583 (diff) |
fixed a bug with admin inserts. i think
Diffstat (limited to 'app')
-rw-r--r-- | app/media/models.py | 5 | ||||
-rw-r--r-- | app/utils/views.py | 2 |
2 files changed, 6 insertions, 1 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) diff --git a/app/utils/views.py b/app/utils/views.py index 87a69bf..71163ce 100644 --- a/app/utils/views.py +++ b/app/utils/views.py @@ -7,7 +7,7 @@ from django.apps import apps from django.shortcuts import render from django.template import RequestContext -from media.models import LuxImage, LuxVideo +from media.models import LuxImage, LuxVideo, LuxAudio from recordings.models import Audio |