diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-19 21:02:59 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-19 21:02:59 +0100 |
commit | c121648619c674aaf70cf1efb41ede6f2fe8429c (patch) | |
tree | 5da07012f616bd53c73ffcf91ae52d8033d44b73 /pyblackbird_cc/resources/models.py | |
parent | 51bbea4361d4fafe93997ed0f3dae05be8389c96 (diff) |
Looking crap but getting there - the basket...
Diffstat (limited to 'pyblackbird_cc/resources/models.py')
-rw-r--r-- | pyblackbird_cc/resources/models.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pyblackbird_cc/resources/models.py b/pyblackbird_cc/resources/models.py index 7bbf244..3dfad06 100644 --- a/pyblackbird_cc/resources/models.py +++ b/pyblackbird_cc/resources/models.py @@ -1,6 +1,9 @@ +from django.conf import settings from django.db import models from django.urls import reverse +from .s3 import get_presigned_obj_url + CURRICULUM_CHOICES = [ ("No curriculum", "No curriculum"), ("English", "English"), @@ -115,8 +118,11 @@ class Resource(models.Model): def get_absolute_url(self): return reverse("resources:resource_detail", kwargs={"resource_id": self.pk}) - def thumbnail_urls(self): - ri = _extract_metadata_from_resource(self) + def thumbnail_urls(self) -> list[str]: + return [ + get_presigned_obj_url(settings.AWS_STORAGE_BUCKET_NAME, f"thumbnails/{f}") + for f in self.thumbnail_filenames + ] class ResourceType(models.Model): |