|
|
@ -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:
|
|
|
|