a ton of fun happened, refactored alot
This commit is contained in:
29
plugins/plant/growlog/forms.py
Normal file
29
plugins/plant/growlog/forms.py
Normal file
@ -0,0 +1,29 @@
|
||||
# plugins/plant/growlog/forms.py
|
||||
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import SelectField, StringField, TextAreaField, BooleanField, SubmitField
|
||||
from wtforms.validators import DataRequired, Length
|
||||
|
||||
class GrowLogForm(FlaskForm):
|
||||
plant_uuid = SelectField(
|
||||
'Plant',
|
||||
choices=[], # injected in view
|
||||
validators=[DataRequired()]
|
||||
)
|
||||
|
||||
event_type = SelectField(
|
||||
'Event Type',
|
||||
choices=[
|
||||
('water', 'Watered'),
|
||||
('fertilizer', 'Fertilized'),
|
||||
('repot', 'Repotted'),
|
||||
('note', 'Note'),
|
||||
('pest', 'Pest Observed'),
|
||||
],
|
||||
validators=[DataRequired()]
|
||||
)
|
||||
|
||||
title = StringField('Title', validators=[Length(max=255)])
|
||||
notes = TextAreaField('Notes', validators=[Length(max=1000)])
|
||||
is_public = BooleanField('Public?')
|
||||
submit = SubmitField('Save Log')
|
Reference in New Issue
Block a user