update import

This commit is contained in:
Alex 2018-06-13 19:50:55 +02:00
parent 167fe9e95e
commit c2cec30113

View File

@ -739,7 +739,8 @@ def import_csv():
file = request.files['file'] file = request.files['file']
for row in DictReader(codecs.iterdecode(file, 'utf-8')): for row in DictReader(codecs.iterdecode(file, 'utf-8')):
numberadded = 0; 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: if book:
print("allreadyexists") print("allreadyexists")
else: else: