from flask_wtf import FlaskForm
from wtform import StringField, PasswordField, SubmitField, BooleanField
from wtform.validator import DataRequired,Length, Email, EqualTo


class RegistrationForm(FlaskForm):
    username= StringField('Username',
                            validators=[DataRequired(), Length(min=2,max=20)])
    email=StringField('Email',
                            validators=[DataRequired(), Email()])
    password=PasswordField('Password',
                            validators=[DataRequired()])     
    comfirm_password=PasswordField('Confirm Password',
                            validators=[DataRequired(),EqualTo('password')])     
    submit= SubmitField('Sign Up')                       



class LoginFrom(FlaskForm):
    email=StringField('Email',
                            validators=[DataRequired(), Email()])
    password=PasswordField('Password',
                            validators=[DataRequired()])     
    remember= BooleanField('Remember Me') 

    submit= SubmitField('Login')                                                                                                           