aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-16 16:57:14 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-16 16:57:14 +0100
commit55e5dfbd51924f1f23e5a651d830206be01e376c (patch)
treee3ea881742b3afc2c473c890cbfd8d98d20cc4a9 /pyblackbird_cc/resources/models.py
parent65c49ea41ecd8e1cce07db1b258a93132cb634d4 (diff)
wip: starting to test feature resource functionality with factories
Diffstat (limited to 'pyblackbird_cc/resources/models.py')
-rw-r--r--pyblackbird_cc/resources/models.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/models.py b/pyblackbird_cc/resources/models.py
index 5a03454..120ecdf 100644
--- a/pyblackbird_cc/resources/models.py
+++ b/pyblackbird_cc/resources/models.py
@@ -114,6 +114,9 @@ class PDFResource(models.Model):
class Meta:
unique_together = ("resource", "file_name")
+ def __str__(self):
+ return self.resource.name
+
def snapshot_file_names(self):
return [f.file_name for f in self.pdf_page_snapshots.all()]
@@ -127,3 +130,20 @@ class PDFPageSnapshot(models.Model):
null=False,
related_name="pdf_page_snapshots",
)
+
+ def __str__(self):
+ return self.name
+
+
+# class FeatureResource(models.Model):
+# resource = models.ForeignKey(
+# "Resource",
+# on_delete=models.CASCADE,
+# null=False,
+# related_name="feature_resources",
+# )
+# slot = models.IntegerField(null=False, choices=[(1, 1), (2, 2), (3, 3)])
+# description = models.CharField(max_length=255, null=False)
+#
+# def __str__(self):
+# return f"{self.resource.name} as a feature in slot {self.slot}"