From a108579de482595f1f92b69dd7a84e70abfa1617 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 11 Jun 2018 21:05:17 +0200 Subject: [PATCH] nothing --- app/views.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views.py b/app/views.py index 9548e4f..cb0f4bd 100755 --- a/app/views.py +++ b/app/views.py @@ -524,7 +524,7 @@ def search_results(searchtype, query, viewby): if searchtype== 'Stack': results=db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query)).order_by(Book.title) - + if searchtype== 'Outliers': results=Book.query.filter(Book.sameness > 50).order_by(Book.title) @@ -678,17 +678,17 @@ def import_csv(): cover = '' if row['file'] == '': file = 'potential.pdf' - # file_extension = '.pdf' - # ptitle = row['title'] - # pbook = Potential(ptitle) - # db.session.add(pbook) - # db.session.commit() - # pbooks = Potential.query.all() - # template = 'app/templates/potential_pdf.html' - # html_string = render_template('potential_pdf.html', pbooks = pbooks) - # html = HTML(string=html_string) - # html.write_pdf(target='app/uploads/potential.pdf') - # print ('writing to potential_pdf') + file_extension = '.pdf' + ptitle = row['title'] + pbook = Potential(ptitle) + db.session.add(pbook) + db.session.commit() + pbooks = Potential.query.all() + template = 'app/templates/potential_pdf.html' + html_string = render_template('potential_pdf.html', pbooks = pbooks) + html = HTML(string=html_string) + html.write_pdf(target='app/uploads/potential.pdf') + print ('writing to potential_pdf') else: fullpath = os.path.join(app.config['UPLOAD_FOLDER'], row['file'])