def criteria_page():
entity_types = matcher.load_entity_types()
taginfo = get_taginfo(entity_types)
for t in entity_types:
t.setdefault('name', t['cats'][0].replace(' by country', ''))
for tag in t['tags']:
if '=' not in tag:
continue
image = taginfo.get(tag, {}).get('image')
if image:
t['image'] = image
break
entity_types.sort(key=lambda t: t['name'].lower())
cat_counts = {cat.name: cat.page_count for cat in Category.query}
return render_template('criteria.html',
entity_types=entity_types,
cat_counts=cat_counts,
taginfo=taginfo)
评论列表
文章目录