From 84abbdeb2c8780b18ab8338d25a4f5770f636d18 Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Thu, 9 Dec 2021 11:48:14 +0100 Subject: [PATCH] feat: threading of fields --- app.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index a254e98..74b0df7 100644 --- a/app.py +++ b/app.py @@ -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 = (