mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-29 19:00:00 +00:00
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:
3
forms.py
3
forms.py
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user