Change energy field from integer to float

Updated the FoodItem model and FoodItemForm to use float for the energy field instead of integer.
This commit is contained in:
2025-08-11 16:51:31 +02:00
parent 5a0dbef28f
commit 3f9bd8984d
2 changed files with 3 additions and 4 deletions

View File

@@ -3,7 +3,6 @@ from wtforms import (
StringField,
PasswordField,
SubmitField,
IntegerField,
FloatField,
)
from wtforms.validators import DataRequired, InputRequired, Optional
@@ -18,7 +17,7 @@ class LoginForm(FlaskForm):
class FoodItemForm(FlaskForm):
barcode = StringField("Barcode", validators=[Optional()])
name = StringField("Product Name", validators=[DataRequired()])
energy = IntegerField(
energy = FloatField(
"Energy per 100g",
validators=[InputRequired()],
render_kw={"inputmode": "decimal"},