예제 #1
0
class UpdatePersonalPageForm(FlaskForm):
    avatar = FileField('Avatar')
    fullname = StringField('Fullname')
    username = StringField('Username')
    email = StringField('Email', widget=EmailInput())
    phone_number = StringField('Phone number', validators=[Length(10, 11)])
    gender = BooleanField('Gender')
예제 #2
0
class LoginForm(FlaskForm):
    user_email = StringField('Email',
                             validators=[DataRequired(),
                                         Email()],
                             widget=EmailInput())
    user_password = PasswordField('Password', validators=[DataRequired()])
    submit = SubmitField('Login')
예제 #3
0
class RegisterForm(LoginForm):
    fullname = StringField('Fullname',
                           validators=[Required()],
                           render_kw={'placeholder': 'Lmao'})
    email = StringField('Email', validators=[Required()], widget=EmailInput())
    confirm = PasswordField(validators=[EqualTo('password')])
    submit = SubmitField('Register')
    remember = None
예제 #4
0
파일: forms.py 프로젝트: vmarttil/larp-ilmo
class LoginForm(FlaskForm):
    '''A form for logging in to the application.'''
    email = StringField(
        'Sähköpostiosoite',
        widget=EmailInput(),
        validators=[DataRequired(message="Sähköpostiosoite on pakollinen")])
    password = PasswordField(
        'Salasana',
        widget=PasswordInput(),
        validators=[DataRequired(message="Salasana on pakollinen")])
    submit = SubmitField('Kirjaudu', widget=SubmitInput())
예제 #5
0
파일: forms.py 프로젝트: vmarttil/larp-ilmo
class RegisterForm(FlaskForm):
    '''A form for registering a new user.'''
    email = StringField(
        'Sähköpostiosoite',
        widget=EmailInput(),
        validators=[
            DataRequired(message="Sähköpostiosoite on pakollinen"),
            Email(message="Anna kelvollinen sähköpostiosoite")
        ])
    password = PasswordField(
        'Salasana',
        widget=PasswordInput(),
        validators=[
            DataRequired(message="Salasana on pakollinen"),
            Length(min=6,
                   max=24,
                   message="Salasanan on oltava 6-24 merkkiä pitkä")
        ])
    first_name = StringField(
        'Etunimi',
        widget=TextInput(),
        validators=[DataRequired(message="Etunimi on pakollinen")])
    last_name = StringField(
        'Sukunimi',
        widget=TextInput(),
        validators=[DataRequired(message="Sukunimi on pakollinen")])
    nickname = StringField('Lempinimi', widget=TextInput())
    phone = StringField(
        'Puhelinnumero',
        widget=TextInput(),
        validators=[
            Regexp(
                '^\+\d+$',
                message='Anna kelvollinen puhelinnumero muodossa +xxxxxxxxxxxxx'
            )
        ])
    birth_date = StringField(
        'Syntymäaika',
        widget=TextInput(),
        validators=[
            Regexp('^(0[1-9]|[12][0-9]|3[01])\.(0[1-9]|1[012])\.(19|20)\d\d$',
                   message='Anna kelvollinen päivämäärä')
        ])
    profile = TextAreaField(
        'Pelaajaprofiilikuvaus',
        widget=TextArea(),
        validators=[
            Length(min=10,
                   max=1000,
                   message="Profiilikuvauksen on oltava 10-1000 merkkiä pitkä")
        ])
    submit = SubmitField('Rekisteröidy', widget=SubmitInput())
예제 #6
0
class AddPersonForm(FlaskForm):

    name = StringField(
        'name',
        [validators.Length(max=Person.name.property.columns[0].type.length),
         validators.InputRequired()],
    )
    email = StringField(
        'email',
        [validators.Length(max=Person.email.property.columns[0].type.length),
         validators.Email(),
         validators.InputRequired()],
        widget=EmailInput(),
    )
예제 #7
0
class EmailField(StringField):
    """ HTML5 email field using the email_validator package to perform
        enhanced email validation.

        You don't need to provide additional validators to this field.
    """

    widget = EmailInput()

    def pre_validate(self, form):
        try:
            result = validate_email(self.data)
            # Replace data with normalised version of email
            self.data = result["email"]
        except EmailNotValidError as e:
            raise ValidationError(str(e))
예제 #8
0
class DemoForm(FlaskForm):
    demo_str = StringField(label='Standard string field')
    demo_select = SelectField(label='Standard dropdown selector',
                              choices=[('Alt1', '1'), ('Alt2', '2'),
                                       ('Alt3', '3')])
    demo_radio = RadioField(label='Standard radio buttons selector',
                            choices=[('Alt1', 'Select 1'),
                                     ('Alt2', 'Select 2'),
                                     ('Alt3', 'Select 3')])
    demo_boolean = BooleanField(label="Standard Yes/No (boolean) field")
    demo_date = DateField(label='Standard date field', widget=DateInput())
    demo_datetime = DateTimeField(label='Standard date and time field',
                                  widget=DateTimeLocalInput())
    demo_email = StringField(label='Email input field', widget=EmailInput())
    demo_textarea = TextAreaField(label='Textarea for more exhaustive input')
    demo_range = IntegerField(label='Range field', widget=RangeInput())
예제 #9
0
class Form(FlaskForm):
    Id = StringField('Identificación:', validators=[DataRequired()])
    Tipo = StringField('Tipo:', validators=[DataRequired()])
    Nombres = StringField('Nombres:', validators=[DataRequired()])
    Apellidos = StringField('Apelldios:', validators=[DataRequired()])
    Edad = IntegerField('Edad:',
                        validators=[DataRequired()],
                        widget=NumberInput(min=18, max=80))
    Email = StringField('Email:',
                        validators=[Email(), DataRequired()],
                        widget=EmailInput())
    Profesion = StringField('Profesion:', validators=[DataRequired()])
    Telefono = StringField('Telefono:', validators=[DataRequired()])
    Cargo = StringField('Cargo:', validators=[DataRequired()])
    Salario = FloatField('Salario:',
                         validators=[DataRequired()],
                         widget=NumberInput())
    Image = FileField('Imagen del empleado: ')
    Sub = SubmitField('Enviar')
예제 #10
0
class EmailField(StringField):
    """HTML5 email field using the email_validator package to perform
    enhanced email validation.

    You don't need to provide additional validators to this field.
    """

    widget = EmailInput()

    def pre_validate(self, form):
        check_deliverability = True
        if app.config.get("DEBUG") or app.testing:
            check_deliverability = False
        try:
            result = validate_email(self.data,
                                    check_deliverability=check_deliverability)
            # Replace data with normalised version of email
            self.data = result["email"]
        except EmailNotValidError as e:
            raise ValidationError(str(e))
예제 #11
0
class RegistrationForm(FlaskForm):
    user_email = StringField('Email', [DataRequired(), Email()],
                             widget=EmailInput())
    user_username = StringField('Username', validators=[DataRequired()])
    user_password = PasswordField('Password',
                                  validators=[
                                      DataRequired(),
                                      EqualTo('pass_confirm',
                                              message='Passwords mismatch')
                                  ])
    pass_confirm = PasswordField('Confirm Password',
                                 validators=[DataRequired()])
    submit = SubmitField('Register')

    def check_email(self, field):
        print(field)
        if User.query.filter_by(user_email=field).first():
            return True

    def check_username(self, field):
        if User.query.filter_by(user_username=field).first():
            return True
예제 #12
0
class ProfileForm(FlaskForm):
    name = StringField('Nombre', validators=[DataRequired()])
    credit_line = StringField('Creditos', validators=[DataRequired()])
    email = StringField('Correo', validators=[Email()], widget=EmailInput())
예제 #13
0
class LoginForm(FlaskForm):
    email = StringField('Email',
                        validators=[DataRequired(), Email()],
                        widget=EmailInput())
    password = PasswordField('Password', validators=[DataRequired()])