things
This commit is contained in:
@ -1,8 +1,16 @@
|
||||
# plugins/growlog/forms.py
|
||||
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import TextAreaField, SelectField, SubmitField
|
||||
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'),
|
||||
@ -11,5 +19,7 @@ class GrowLogForm(FlaskForm):
|
||||
('pest', 'Pest Observed')
|
||||
], validators=[DataRequired()])
|
||||
|
||||
note = TextAreaField('Notes', validators=[Length(max=1000)])
|
||||
submit = SubmitField('Add Log')
|
||||
title = StringField('Title', validators=[Length(max=255)])
|
||||
notes = TextAreaField('Notes', validators=[Length(max=1000)])
|
||||
is_public = BooleanField('Public?')
|
||||
submit = SubmitField('Add Log')
|
||||
|
Reference in New Issue
Block a user