forked from edward/owl-map
Get item from database, or download if missing
This commit is contained in:
parent
053a2174e9
commit
a7e0a5fa8e
10
web_view.py
10
web_view.py
|
@ -676,6 +676,16 @@ skip_isa = {
|
||||||
}
|
}
|
||||||
skip_tags = {"Key:addr:street"}
|
skip_tags = {"Key:addr:street"}
|
||||||
|
|
||||||
|
def get_item(item_id):
|
||||||
|
item = model.Item.query.get(item_id)
|
||||||
|
if item:
|
||||||
|
return item
|
||||||
|
item = get_and_save_item(f"Q{item_id}")
|
||||||
|
database.session.add(item)
|
||||||
|
database.session.commit()
|
||||||
|
return item
|
||||||
|
|
||||||
|
|
||||||
def get_items(item_ids):
|
def get_items(item_ids):
|
||||||
items = []
|
items = []
|
||||||
for item_id in item_ids:
|
for item_id in item_ids:
|
||||||
|
|
Loading…
Reference in a new issue