get alco prediction and table working
Build and Push Image / Build and push image (push) Has been skipped
Build and Push Image / Build and push image (push) Has been skipped
This commit is contained in:
+12
-3
@@ -1,6 +1,7 @@
|
||||
from bokeh.core.enums import SpatialUnitsType
|
||||
import mongo.build_db as beer_database
|
||||
import mongo.query_db as beer_database_query
|
||||
from table import table_builder
|
||||
|
||||
from flask import Flask, render_template, request, jsonify, redirect, session
|
||||
from flask_wtf import FlaskForm, CSRFProtect
|
||||
@@ -14,6 +15,7 @@ from charts import BeerCharts
|
||||
from bokeh.io import output_file, show
|
||||
from bokeh.layouts import row
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
app.secret_key = 'testsecret' #this value will change
|
||||
|
||||
@@ -62,11 +64,16 @@ def index():
|
||||
def updater():
|
||||
if 'logged_in' not in session:
|
||||
return redirect("/")
|
||||
#create_graphs()
|
||||
predicted_alc_table = table_builder.TableBuilder().table_build()
|
||||
tr_replace_string = '<tr align="center" style="border-bottom:1pt solid black;">'
|
||||
beer_html = predicted_alc_table.to_html(col_space='75px', index=False,
|
||||
justify='center', border=3).replace('<tr>', tr_replace_string)
|
||||
query_db = beer_database_query.pool_query()
|
||||
query = query_db.get_top(10, "sg")
|
||||
form = dataForm()
|
||||
|
||||
|
||||
|
||||
if form.validate_on_submit():
|
||||
database = beer_database.beer_data()
|
||||
new_record = {
|
||||
@@ -91,9 +98,11 @@ def updater():
|
||||
database.create_re_record(new_record["beer_run_id"], new_record["beer_type"], new_record["sg"],
|
||||
new_record["date"], final_run_value, new_record["comment"])
|
||||
|
||||
return render_template("updater.html", list=query, form=form, success=True, updater_name = "Saucy Beer Maker")
|
||||
return render_template("updater.html", beer_data = beer_html
|
||||
, list=query, form=form, success=True, updater_name = "Saucy Beer Maker")
|
||||
else:
|
||||
return render_template("updater.html", list=query, form=form, sucess=False)
|
||||
return render_template("updater.html", beer_data = beer_html
|
||||
, list=query, form=form, sucess=False)
|
||||
|
||||
# @app.route("/update_db", methods=["POST"])
|
||||
# def beer_data_update():
|
||||
|
||||
Reference in New Issue
Block a user