Refactor.
This commit is contained in:
parent
5c51341e7f
commit
5868810ddc
5
app.py
5
app.py
|
@ -515,10 +515,9 @@ def get_labels_db(keys):
|
|||
def build_other_set(entity):
|
||||
other_items = set()
|
||||
for key in find_more_props.keys():
|
||||
if key not in entity['claims']:
|
||||
for claim in entity['claims'].get(key, []):
|
||||
if 'datavalue' not in claim['mainsnak']:
|
||||
continue
|
||||
for claim in entity['claims'][key]:
|
||||
if 'datavalue' in claim['mainsnak']:
|
||||
other_items.add(claim['mainsnak']['datavalue']['value']['id'])
|
||||
return other_items
|
||||
|
||||
|
|
Loading…
Reference in a new issue