From c2cec301133ee226d5268ee997f7b166d8ed8593 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 13 Jun 2018 19:50:55 +0200 Subject: [PATCH] update import --- app/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index 3160d42..169cc9a 100755 --- a/app/views.py +++ b/app/views.py @@ -739,7 +739,8 @@ def import_csv(): file = request.files['file'] for row in DictReader(codecs.iterdecode(file, 'utf-8')): numberadded = 0; - book = Book.query.filter_by(title=row['title']).first() + book = db.session.query(Book).filter(Book.title==row['title']).first() + #book = Book.query.filter_by(title=row['title']).first() if book: print("allreadyexists") else: