make sure num_books also has a value, not just a positive one, so I am force to fill it in on submit

This commit is contained in:
2020-12-31 11:52:27 +11:00
parent 911d37ed25
commit c99342232c

View File

@@ -33,7 +33,7 @@ class SeriesSchema(ma.SQLAlchemyAutoSchema):
class SeriesForm(FlaskForm): class SeriesForm(FlaskForm):
id = HiddenField() id = HiddenField()
title = StringField('Title:', [validators.DataRequired()]) title = StringField('Title:', [validators.DataRequired()])
num_books = IntegerField('Number of Books:', [validators.NumberRange(min=1)]) num_books = IntegerField('Number of Books:', [validators.DataRequired(), validators.NumberRange(min=1)])
calcd_rating = StringField('Avg Rating:' ) calcd_rating = StringField('Avg Rating:' )
note = TextAreaField('Notes:') note = TextAreaField('Notes:')
submit = SubmitField('Save' ) submit = SubmitField('Save' )