diff --git a/app/forms/consumable.py b/app/forms/consumable.py index 86364fe..a63b3e6 100644 --- a/app/forms/consumable.py +++ b/app/forms/consumable.py @@ -1,24 +1,24 @@ -from flask_wtf import Form +from flask_wtf import FlaskForm from wtforms import SelectField, StringField, SubmitField from wtforms.validators import Length -class SelectConsumableForm(Form): +class SelectConsumableForm(FlaskForm): consumable = SelectField('Consumable', coerce=int) submit = SubmitField(label='Do it!') -class CreateConsumableForm(Form): +class CreateConsumableForm(FlaskForm): name = StringField('Name', validators=[Length(1, 255)]) unit = StringField('Unit', validators=[Length(1, 255)]) submit = SubmitField(label='Do it!') -class EditConsumableForm(Form): +class EditConsumableForm(FlaskForm): name = StringField('Name', validators=[Length(1, 255)]) unit = StringField('Unit', validators=[Length(1, 255)]) submit = SubmitField(label='Do it!') -class DeletConsumableForm(Form): +class DeletConsumableForm(FlaskForm): submit = SubmitField(label='Do it!') \ No newline at end of file diff --git a/app/forms/misc.py b/app/forms/misc.py index b291c7f..7a4afd9 100644 --- a/app/forms/misc.py +++ b/app/forms/misc.py @@ -1,6 +1,6 @@ -from flask_wtf import Form +from flask_wtf import FlaskForm from wtforms import SubmitField -class DeleteAccountForm(Form): +class DeleteAccountForm(FlaskForm): submit = SubmitField(label='Really delete my account!') diff --git a/app/forms/pitstop.py b/app/forms/pitstop.py index 93851c8..842eacb 100644 --- a/app/forms/pitstop.py +++ b/app/forms/pitstop.py @@ -1,14 +1,14 @@ -from flask_wtf import Form +from flask_wtf import FlaskForm from wtforms import DateField, IntegerField, DecimalField, SubmitField from .checks import * -class DeletePitStopForm(Form): +class DeletePitStopForm(FlaskForm): submit = SubmitField(label='Really delete this pitstop!') -class EditPitstopForm(Form): +class EditPitstopForm(FlaskForm): date = DateField('Date of Pitstop', validators=[date_check]) odometer = IntegerField('Odometer (km)', validators=[odometer_check]) litres = DecimalField('Litres (l)', places=2, validators=[litres_check]) @@ -34,7 +34,7 @@ class EditPitstopForm(Form): self.costs.default = self.costs.data -class CreatePitstopForm(Form): +class CreatePitstopForm(FlaskForm): date = DateField('Date of Pitstop', validators=[date_check]) odometer = IntegerField('Odometer (km)', validators=[odometer_check]) litres = DecimalField('Litres (l)', places=2, validators=[litres_check]) diff --git a/app/forms/service.py b/app/forms/service.py index 2492959..3e11c62 100644 --- a/app/forms/service.py +++ b/app/forms/service.py @@ -1,11 +1,11 @@ -from flask_wtf import Form +from flask_wtf import FlaskForm from wtforms import DateField, IntegerField, DecimalField, SubmitField, TextAreaField from wtforms.validators import Length from .checks import * -class CreateServiceForm(Form): +class CreateServiceForm(FlaskForm): date = DateField('Date of Service', validators=[date_check]) odometer = IntegerField('Odometer (km)', validators=[odometer_check]) costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check]) @@ -33,11 +33,11 @@ class CreateServiceForm(Form): self.costs.default = 0 -class DeleteServiceForm(Form): +class DeleteServiceForm(FlaskForm): submit = SubmitField(label='Really delete this service!') -class EditServiceForm(Form): +class EditServiceForm(FlaskForm): date = DateField('Date of Service', validators=[date_check]) odometer = IntegerField('Odometer (km)', validators=[odometer_check]) costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check]) diff --git a/app/forms/vehicle.py b/app/forms/vehicle.py index 1ff0cfd..4e42080 100644 --- a/app/forms/vehicle.py +++ b/app/forms/vehicle.py @@ -1,20 +1,20 @@ -from flask_wtf import Form +from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, SelectField, SelectMultipleField from wtforms.validators import Length -class SelectVehicleForm(Form): +class SelectVehicleForm(FlaskForm): vehicle = SelectField('Vehicle', coerce=int) submit = SubmitField(label='Do it!') -class EditVehicleForm(Form): +class EditVehicleForm(FlaskForm): name = StringField('Name', validators=[Length(1, 255)]) consumables = SelectMultipleField('Consumables', coerce=int,validators=[]) submit = SubmitField(label='Do it!') -class DeleteVehicleForm(Form): +class DeleteVehicleForm(FlaskForm): submit = SubmitField(label='Do it!')