diff options
Diffstat (limited to 'pyblackbird_cc/resources/models.py')
-rw-r--r-- | pyblackbird_cc/resources/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/models.py b/pyblackbird_cc/resources/models.py index 120ecdf..2b73c89 100644 --- a/pyblackbird_cc/resources/models.py +++ b/pyblackbird_cc/resources/models.py @@ -79,6 +79,15 @@ class Resource(models.Model): def __str__(self): return self.name + def get_pdf_file_names(self): + return [p.file_name for p in self.pdf_resources.all()] + + def get_pdf_snapshot_file_names(self): + rs = self.pdf_resources.all() + sh = [sh for sh in rs.values_list("pdf_page_snapshots__file_name", flat=True)] + out = [s for s in sh if s] + return out + class ResourceType(models.Model): name = models.CharField(max_length=255, null=False) |