diff options
Diffstat (limited to 'alphabetlearning/resources/views.py')
-rw-r--r-- | alphabetlearning/resources/views.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/alphabetlearning/resources/views.py b/alphabetlearning/resources/views.py index c3d1bcd..773b1c2 100644 --- a/alphabetlearning/resources/views.py +++ b/alphabetlearning/resources/views.py @@ -293,6 +293,10 @@ def resource_detail(request, resource_id): """ resource_obj = get_object_or_404(Resource, pk=resource_id) resource_metadata = _extract_metadata_from_resource(resource_obj) + try: + price = resource_obj.price_obj.first().price / 1000 + except AttributeError: + price = 0 resource = { "id": resource_obj.id, "name": resource_obj.name, @@ -306,6 +310,7 @@ def resource_detail(request, resource_id): ), "age_range": resource_obj.age_range, "curriculum": resource_obj.curriculum, + "price": price, "pdf_filenames": resource_metadata.pdf_filenames, "pdf_urls": resource_metadata.pdf_urls, "thumbnails": list( |