From 9a841921f4adabc74f77ed7783a1e2cad7a51977 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 13 Nov 2021 20:19:04 +0000 Subject: [PATCH] Include labels for ISA items in item detail. --- matcher/api.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/matcher/api.py b/matcher/api.py index 0dd1853..ab1d200 100644 --- a/matcher/api.py +++ b/matcher/api.py @@ -778,6 +778,8 @@ def item_detail(item): "label": heritage_designation_item.label(), }) + isa_items = [get_item(isa["numeric-id"]) for isa in item.get_isa()] + d = { "qid": item.qid, "label": item.label(), @@ -785,11 +787,7 @@ def item_detail(item): "markers": locations, "image_list": image_filenames, "street_address": street_address, - # "isa_list": item.get_isa_qids(), - "isa_list": [ - {"qid": isa["id"], "label": get_item(isa["numeric-id"]).label()} - for isa in item.get_isa() - ], + "isa_list": [{"qid": isa.qid, "label": isa.label()} for isa in isa_items if isa], "closed": item.closed(), "heritage_designation": heritage_designation, }