diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-20 20:17:25 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-20 20:17:25 +0100 |
commit | ff1aa3aa113e507f870eba4c96099946f154fb22 (patch) | |
tree | db14562172d6936bdcc993b6af45ccbd2f2d8d89 /pyblackbird_cc/resources/models.py | |
parent | d048429fefaa92c7600b46fec9d38e1e9e862457 (diff) |
wip:
- Passing test for raw ORM handling to find snapshot files from an
object
- Quietens down pytest output
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) |