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,
date, test_user, temp, hardness, salt="", comment=""):
date, test_user, temp, hardness, stabiliser, salt="", comment=""):
"""
create_re_record creates a whole new record
takes the required 7 inputs
@ -43,6 +43,7 @@ class pool_data:
6. test_user
7. temp
8. hardness
9. stabiliser
9. salt (optional)
10. comment(optional)
It will autogenerate the id string
@ -59,6 +60,7 @@ class pool_data:
"salt": f"{salt}",
"temp": f"{temp}",
"hardness": f"{hardness}",
"stabiliser": f"{stabiliser}",
"date": f"{date}",
"test_user": f"{test_user}",
"comment": f"{comment}"

View File

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