update order and add stabiliser

This commit is contained in:
Andrew Ridgway 2024-03-28 16:21:48 +10:00
parent 94bcc68b78
commit e26d0774f4
2 changed files with 12 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class pool_data:
def create_re_record(self, ph, total_chlorine, free_chlorine, alkalinity, def create_re_record(self, ph, total_chlorine, free_chlorine, alkalinity,
date, test_user, temp, hardness, salt="", comment=""): date, test_user, temp, hardness, stabiliser, salt="", comment=""):
""" """
create_re_record creates a whole new record create_re_record creates a whole new record
takes the required 7 inputs takes the required 7 inputs
@ -43,6 +43,7 @@ class pool_data:
6. test_user 6. test_user
7. temp 7. temp
8. hardness 8. hardness
9. stabiliser
9. salt (optional) 9. salt (optional)
10. comment(optional) 10. comment(optional)
It will autogenerate the id string It will autogenerate the id string
@ -59,6 +60,7 @@ class pool_data:
"salt": f"{salt}", "salt": f"{salt}",
"temp": f"{temp}", "temp": f"{temp}",
"hardness": f"{hardness}", "hardness": f"{hardness}",
"stabiliser": f"{stabiliser}",
"date": f"{date}", "date": f"{date}",
"test_user": f"{test_user}", "test_user": f"{test_user}",
"comment": f"{comment}" "comment": f"{comment}"

View File

@ -24,13 +24,14 @@ class dataForm(FlaskForm):
test_user = RadioField("Tester:", test_user = RadioField("Tester:",
choices=[("Isabella"), ("Heather"), ("Ariah")]) choices=[("Isabella"), ("Heather"), ("Ariah")])
Date = DateField("Date:") Date = DateField("Date:")
PH = DecimalField("PH:")
total_chlorine = IntegerField("Total Chlorine:")
free_chlorine = IntegerField("Free Chlorine:") free_chlorine = IntegerField("Free Chlorine:")
total_chlorine = IntegerField("Total Chlorine:")
alkalinity = DecimalField("Alkalinity:") alkalinity = DecimalField("Alkalinity:")
PH = DecimalField("PH:")
hardness = IntegerField("Hardness")
stabiliser = IntegerField("CYA - Stabliser")
salt = IntegerField("Salt:") salt = IntegerField("Salt:")
temp = DecimalField("Water Temperature") temp = DecimalField("Water Temperature")
hardness = IntegerField("Hardness")
comment = TextAreaField("Any Comments?") comment = TextAreaField("Any Comments?")
submit = SubmitField("Write it, Write it REAAAAAAL GOOOD") submit = SubmitField("Write it, Write it REAAAAAAL GOOOD")
@ -70,6 +71,7 @@ def updater():
"test_user": f'{form.test_user.data}', "test_user": f'{form.test_user.data}',
"temp": f'{form.temp.data}', "temp": f'{form.temp.data}',
"hardness": f'{form.hardness.data}', "hardness": f'{form.hardness.data}',
"stabiliser" : f'{form.stabiliser.data}',
"comment": f'{form.comment.data}' "comment": f'{form.comment.data}'
} }
if database.record_exists(new_record["date"], new_record["test_user"]): if database.record_exists(new_record["date"], new_record["test_user"]):
@ -81,7 +83,8 @@ def updater():
else: else:
database.create_re_record(new_record["ph"], new_record["total_chlorine"], new_record["free_chlorine"], database.create_re_record(new_record["ph"], new_record["total_chlorine"], new_record["free_chlorine"],
new_record["alkalinity"], new_record["date"], new_record["test_user"], new_record["alkalinity"], new_record["date"], new_record["test_user"],
new_record["temp"], new_record["hardness"], new_record["salt"], new_record["comment"]) new_record["temp"], new_record["hardness"], new_record["stabiliser"],
new_record["salt"], new_record["comment"])
return render_template("updater.html", list=query, form=form) return render_template("updater.html", list=query, form=form)
@ -101,7 +104,8 @@ def pool_data_update():
else: else:
database.create_re_record(new_record["ph"], new_record["total_chlorine"], new_record["free_chlorine"], database.create_re_record(new_record["ph"], new_record["total_chlorine"], new_record["free_chlorine"],
new_record["alkalinity"], new_record["date"], new_record["test_user"], new_record["alkalinity"], new_record["date"], new_record["test_user"],
new_record["temp"], new_record["hardness"], new_record["salt"], new_record["comment"]) new_record["temp"], new_record["hardness"], new_record["stabiliser"],
new_record["salt"], new_record["comment"])
@app.route("/pool_top/<int:return_number>/<string:field>") @app.route("/pool_top/<int:return_number>/<string:field>")