rollerverbrauch/app/forms/vehicle.py

26 lines
654 B
Python
Raw Permalink Normal View History

2016-11-06 18:53:13 +01:00
from flask_wtf import FlaskForm
2021-06-20 08:43:46 +02:00
from wtforms import (
StringField,
SubmitField,
SelectField,
SelectMultipleField,
BooleanField,
)
2016-11-01 16:36:28 +01:00
from wtforms.validators import Length
2016-11-06 18:53:13 +01:00
class SelectVehicleForm(FlaskForm):
2021-06-20 08:43:46 +02:00
vehicle = SelectField("Vehicle", coerce=int)
submit = SubmitField(label="Do it!")
2016-11-01 16:36:28 +01:00
2016-11-06 18:53:13 +01:00
class EditVehicleForm(FlaskForm):
2021-06-20 08:43:46 +02:00
name = StringField("Name", validators=[Length(1, 255)])
consumables = SelectMultipleField("Consumables", coerce=int, validators=[])
is_active = BooleanField("Is active")
submit = SubmitField(label="Do it!")
2016-11-01 16:36:28 +01:00
2016-11-06 18:53:13 +01:00
class DeleteVehicleForm(FlaskForm):
2021-06-20 08:43:46 +02:00
submit = SubmitField(label="Do it!")