aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-03 16:26:16 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-03 16:26:16 +0100
commit7b757fcd38ca560139aa3c4c86ae57b4c6afe2dd (patch)
tree76f63bd0f576660154f90dd5f2119edd9b3d1006 /pyblackbird_cc/resources/models.py
parenta75aca148ba7db29e14e30f2e0707b1efac1ff94 (diff)
wip: adding the update thumbnails form
Diffstat (limited to 'pyblackbird_cc/resources/models.py')
-rw-r--r--pyblackbird_cc/resources/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/models.py b/pyblackbird_cc/resources/models.py
index 05a848c..31085c0 100644
--- a/pyblackbird_cc/resources/models.py
+++ b/pyblackbird_cc/resources/models.py
@@ -1,4 +1,5 @@
from django.db import models
+from django.urls import reverse
CURRICULUM_CHOICES = [
("No curriculum", "No curriculum"),
@@ -98,6 +99,9 @@ class Resource(models.Model):
sh = [sh for sh in rs.values_list("pdf_page_snapshots__file_name", flat=True)]
return [s for s in sh if s]
+ def get_absolute_url(self):
+ return reverse("resources:resource_detail", kwargs={"resource_id": self.pk})
+
class ResourceType(models.Model):
name = models.CharField(max_length=255, null=False)