From eba4c1a3113d24319bccc5c52d4d93838334bd31 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 3 Jul 2022 20:21:02 +0200 Subject: db now in models; modules. --- app/modules/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/modules/common.py') diff --git a/app/modules/common.py b/app/modules/common.py index f9ccba6..ff0aec7 100644 --- a/app/modules/common.py +++ b/app/modules/common.py @@ -25,8 +25,8 @@ def add_item(module, table): if form.validate_on_submit(): model = getattr(models, table) table_fields = inspect.signature(model).parameters - form_values = {key: request.form[key] for key in table_fields} - print(f"Ready to insert {form_values}") + form_values = {key: request.form.get(key) for key in table_fields} + print(f"Ready to insert in {table} from {module} {form_values}") record = model(**form_values) db.session.add(record) db.session.commit() -- cgit v1.2.3