From 1814b23b469b3b7f9c653c4bc206876297317d3b Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Wed, 18 Dec 2019 19:13:23 +0000 Subject: [PATCH] Only show items with an image. --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index a3260d4..8d9df3b 100755 --- a/app.py +++ b/app.py @@ -757,7 +757,7 @@ def browse_facets(): def get_db_items(params): ''' Get items for browse page based on criteria. ''' - q = Item.query + q = Item.query.filter_by(is_artwork=True) for pid, qid in params: q = (q.join(Triple, Item.item_id == Triple.subject_id, aliased=True) .filter(Triple.predicate_id == pid[1:], Triple.object_id == qid[1:])) @@ -820,7 +820,7 @@ def browse_page(): total = q_items.count() pager = Pagination(page, page_size, total) - items = pager.slice(all_items) + items = [item for item in pager.slice(all_items) if item.image_filename()] cache_name = f'{flat}_{page}_{page_size}' detail = get_image_detail_with_cache(items, cache_name)