diff options
Diffstat (limited to 'pyblackbird_cc/resources/models.py')
-rw-r--r-- | pyblackbird_cc/resources/models.py | 20 |
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}" |