|
|
|
@ -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'])
|
|
|
|
|