aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-14 20:31:22 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-14 20:31:22 +0100
commitc976b9f3685fb506f3095dbf705f864e21121f93 (patch)
treedf6026690ed4955f74314daef5bc698ca6a72285 /pyblackbird_cc/resources/views.py
parent64c1e2ffd2898f41fc6c5e0d080541e7289fe442 (diff)
Added cards to resource list page
Diffstat (limited to 'pyblackbird_cc/resources/views.py')
-rw-r--r--pyblackbird_cc/resources/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/views.py b/pyblackbird_cc/resources/views.py
index c3e79ff..c1d7672 100644
--- a/pyblackbird_cc/resources/views.py
+++ b/pyblackbird_cc/resources/views.py
@@ -27,8 +27,10 @@ logger = logging.getLogger(__name__)
class ResourceInfo:
id: int
name: str
+ description: str
main_resource_category_name: str
additional_resource_category_name: str | None
+ age_range: str | None
pdf_filenames: list[str]
pdf_urls: list[str]
snapshot_urls: dict[str, list[str]]
@@ -79,8 +81,10 @@ def _extract_metadata_from_resource(resource_obj) -> ResourceInfo | None:
return ResourceInfo(
id=resource_obj.id,
name=resource_obj.name,
+ description=resource_obj.description,
main_resource_category_name=resource_obj.main_resource_category.name,
additional_resource_category_name=arc_name,
+ age_range=resource_obj.age_range,
pdf_filenames=pdf_resource_filenames,
pdf_urls=pdf_urls,
snapshot_urls=snapshot_url_dict,