master
Alice 7 years ago
parent 9c84e75e8c
commit a108579de4

@ -524,7 +524,7 @@ def search_results(searchtype, query, viewby):
if searchtype== 'Stack': if searchtype== 'Stack':
results=db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query)).order_by(Book.title) results=db.session.query(Book).join(Book.stacks).filter(Stack.stack_name.contains(query)).order_by(Book.title)
if searchtype== 'Outliers': if searchtype== 'Outliers':
results=Book.query.filter(Book.sameness > 50).order_by(Book.title) results=Book.query.filter(Book.sameness > 50).order_by(Book.title)
@ -678,17 +678,17 @@ def import_csv():
cover = '' cover = ''
if row['file'] == '': if row['file'] == '':
file = 'potential.pdf' file = 'potential.pdf'
# file_extension = '.pdf' file_extension = '.pdf'
# ptitle = row['title'] ptitle = row['title']
# pbook = Potential(ptitle) pbook = Potential(ptitle)
# db.session.add(pbook) db.session.add(pbook)
# db.session.commit() db.session.commit()
# pbooks = Potential.query.all() pbooks = Potential.query.all()
# template = 'app/templates/potential_pdf.html' template = 'app/templates/potential_pdf.html'
# html_string = render_template('potential_pdf.html', pbooks = pbooks) html_string = render_template('potential_pdf.html', pbooks = pbooks)
# html = HTML(string=html_string) html = HTML(string=html_string)
# html.write_pdf(target='app/uploads/potential.pdf') html.write_pdf(target='app/uploads/potential.pdf')
# print ('writing to potential_pdf') print ('writing to potential_pdf')
else: else:
fullpath = os.path.join(app.config['UPLOAD_FOLDER'], row['file']) fullpath = os.path.join(app.config['UPLOAD_FOLDER'], row['file'])

Loading…
Cancel
Save