forms.py 1.1 KB

123456789101112131415161718192021222324
  1. from flask_wtf import FlaskForm
  2. from wtforms import StringField, PasswordField, SubmitField, BooleanField, IntegerField, DateTimeField, SelectField
  3. from wtforms.validators import DataRequired, Length, EqualTo, Email, ValidationError
  4. import datetime
  5. class PlayerPointsForm(FlaskForm):
  6. # total = StringField("TotalPoints", validators = [DataRequired(), Length(min=2, max=20)])
  7. player1 = StringField("Player 1", validators=[DataRequired(), Length(min=0, max=20)])
  8. player2 = StringField("Player 2", validators=[DataRequired(), Length(min=0, max=20)])
  9. player3 = StringField("Player 3", validators=[DataRequired(), Length(min=0, max=20)])
  10. player4 = StringField("Player 4", validators=[DataRequired(), Length(min=0, max=20)])
  11. player5 = StringField("Player 5", validators=[DataRequired(), Length(min=0, max=20)])
  12. points_submit = SubmitField("Add Points")
  13. def validate_points(self, rfid_tag):
  14. return True
  15. class LoginForm(FlaskForm):
  16. username = StringField("username", validators=[DataRequired()])
  17. password = PasswordField("password", validators=[DataRequired()])