feat: threading of fields

This commit is contained in:
cellarspoon 2021-12-09 11:48:14 +01:00
parent a63cfb7f0c
commit 84abbdeb2c
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410

16
app.py
View File

@ -78,11 +78,23 @@ def upload():
os.path.join(CWD, "metadatum", metadata_name)
)
fields = ["title", "author", "comments", "timestamp", "tags"]
side_a = [
field
for field in upload_form.data.keys()
if field in fields and upload_form.data[field] == "side a"
]
side_b = [
field
for field in upload_form.data.keys()
if field in fields and upload_form.data[field] == "side b"
]
make_cards(
pdf_path,
metadata_conn,
["title", "timestamp", "comments", "authors"],
["tags"],
side_a,
side_b,
)
gen_msg = (