class AddSeason(FlaskForm): today = get_est() seasonname = StringField('Season Name', validators=[DataRequired()]) startdate = DateField('Start Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") enddate = DateField('End Date Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") current = SelectField('Current Season Y/N', choices=yn) submit = SubmitField('Create Season')
class SeasonMan(FlaskForm): today = get_est() seasonname = StringField('Update Season Name') startdate = DateField('Update Start Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") enddate = DateField('Update End Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") current = SelectField('Current Season Y/N', choices=yn, default='N') submit = SubmitField('Update Season')
class BogMan(FlaskForm): today = get_est() bogged = SelectField('Bogged', choices=[('Y', 'Bogged'), ('N', 'Not Bogged')], default='Y') active = SelectField('Active Player', choices=yn, default='Y') bogdate = DateField('Bogged Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") change = RadioField('Change Bog Date?', choices=[('Y', 'Change Date'), ('N', 'Ignore Date')], default='N') submit = SubmitField('Update Bog')
class UpdateMatch(FlaskForm): today = get_est() matchdate = DateField('Match Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") starttime = TimeField('Start Time', validators=[TimeField]) playoff = BooleanField('Playoff Match', default=False) submit = SubmitField('Update Match') def validate_opposingteam(self, opposingteam): # 0 means 'New team..' if self.teampick.data == 0: if len(self.opposingteam.data) == 0: raise ValidationError( 'Select Opposing Team from list or Enter a team name in the text box.' )
class AddMatch(FlaskForm): # Pick list picks = [] today = get_est() teampick = SelectField('Pick Team', choices=picks, coerce=int) opposingteam = StringField('Opposing Team') matchdate = DateField('Match Date', validators=[DateField], default=today.today(), format="%Y-%m-%d") starttime = TimeField('Start Time', validators=[TimeField]) playoff = BooleanField('Playoff Match', default=False) submit = SubmitField('Create Match') def validate_opposingteam(self, opposingteam): # 0 means 'New team..' if self.teampick.data == 0: if len(self.opposingteam.data) == 0: raise ValidationError( 'Select Opposing Team from list or Enter a team name in the text box.' )
def before_request(): if current_user.is_authenticated: current_user.last_seen = get_est() db.session.commit()