Exemplo n.º 1
0
class RegistrationForm(Form):
    email = TextField("email",
                      [validators.Email(message="Not a valid email address")])
    username = TextField(
        "username", [validators.Length(min=6),
                     Unique(User, User.username)])
    password = PasswordField("Password", [
        validators.Required(),
        validators.EqualTo("Confirm", message="Passwords must match")
    ])
    confirm = PasswordField("Repeat Password")
    recaptcha = RecaptchaField()
Exemplo n.º 2
0
class FormPassword(wtf.Form):
    password = wtf.PasswordField(
        label='Mot de passe',
        validators=[
            validators.Required('Information obligatoire'), password_validator
        ])
    retype_password = wtf.PasswordField(
        label='Confirmation du mot de passe',
        validators=[
            validators.EqualTo(
                'password', message='Les deux mots de passe sont differents')
        ])
Exemplo n.º 3
0
class UserSettingsForm(Form):
    password = PasswordField('Current Password', [validators.Required()])
    email = TextField('Email', [
        validators.Required(),
        validators.Email(),
        validators.Length(max=255)
    ])
    new_password = PasswordField('New Password', [
        validators.Optional(),
        validators.EqualTo('new_password_confirm',
                           message='New passwords did not match')
    ])
    new_password_confirm = PasswordField('Confirm New Password')
    submit = SubmitField('Change Settings')
Exemplo n.º 4
0
class RegistrationForm(LoginForm):
    email = EmailField('Email Address', [
        validators.Required(),
        validators.Length(min=6, max=64),
        validators.Email(u'Invalid Email Address')
    ])
    name = TextField('Full Name (Optional)', [
        validators.Optional(),
        validators.Length(min=2, max=64)])
    phone = TextField('Phone Number', [
        validators.Optional(),
        validators.Length(min=5, max=20)])
    password = PasswordField('New Password', [
        validators.Required(),
        validators.EqualTo('confirm', message='Passwords must match')
        ])
    confirm = PasswordField('Repeat Password')
    admin = BooleanField('Make me an Admin')
Exemplo n.º 5
0
class SignupForm(Form):
    username = f.TextField('Username', [
        v.Length(min=3, max=128),
        v.Regexp(r'^[^@]*$', message="Username shouldn't be an email address")
    ])
    email = html5.EmailField('Email address', [
        v.Length(min=3, max=128),
        v.Email(message="This should be a valid email address.")
    ])
    password = f.PasswordField('Password', [
        v.Required(),
        v.Length(
            min=8,
            message=
            "It's probably best if your password is longer than 8 characters."
        ),
        v.EqualTo('confirm', message="Passwords must match.")
    ])
    confirm = f.PasswordField('Confirm password')

    # Will only work if set up in config (see http://packages.python.org/Flask-WTF/)
    captcha = f.RecaptchaField('Captcha')
Exemplo n.º 6
0
class FormRegister(wtf.Form):
    id = wtf.HiddenField()
    name = wtf.StringField(
        label='Nom Entreprise',
        validators=[validators.Required('Nom de l\'entreprise obligatoire')])
    email = wtf.StringField(label='Adresse Email',
                            validators=[
                                validators.Required('Information obligatoire'),
                                validators.Email('Adresse email invalide'),
                                unique_email_validator
                            ])

    password = wtf.PasswordField(
        label='Mot de passe',
        validators=[
            validators.Required('Mot de passe obligatoire'), password_validator
        ])
    retype_password = wtf.PasswordField(
        label='Confirmation du mot de passe',
        validators=[
            validators.EqualTo(
                'password', message='Les deux mots de passe sont differents')
        ])

    phone = wtf.StringField(
        label='Telephone',
        validators=[
            validators.Required('Information du telephone obligatoire')
        ])
    pays = wtf.StringField(
        label='Pays',
        validators=[validators.Required('Information du pays obligatoire')])
    ville = wtf.StringField(
        label='Ville',
        validators=[
            validators.Required('Information de la ville obligatoire')
        ])
    adresse_un = wtf.StringField(label='Adresse 1')
    adresse_deux = wtf.StringField(label='Adresse 2')
Exemplo n.º 7
0
class RegisterForm(Form):
    fullname = TextField('Full name',
            [validators.Length(min=3, max=35,
                message="Full name must be between 3 and 35 characters long")])

    username = TextField('User name',
            [validators.Length(min=3, max=35,
                message="User name must be between 3 and 35 characters long"),
                Unique(db.session, model.User, model.User.name,
                    message="The user name is already taken")])

    email_addr = TextField('Email Address',
            [validators.Length(min=3, max=35,
                message="Email must be between 3 and 35 characters long"),
                validators.Email(),
                Unique(db.session, model.User, model.User.email_addr,
                    message="Email is already taken")])

    password = PasswordField('New Password',
            [validators.Required(message="Password cannot be empty"),
                validators.EqualTo('confirm', message='Passwords must match')])

    confirm = PasswordField('Repeat Password')
Exemplo n.º 8
0
class FormRegisterUserAdmin(wtf.Form):
    first_name = wtf.StringField(
        label='Prenom',
        validators=[validators.Required('Information obligatoire')])
    last_name = wtf.StringField(
        label='Nom',
        validators=[validators.Required('Information obligatoire')])
    email = wtf.StringField(label='Adresse Email',
                            validators=[
                                validators.Email('Email non valid'),
                                validators.Required('Information obligatoire'),
                                unique_email_validator
                            ])
    password = wtf.PasswordField(
        label='Mot de passe',
        validators=[
            validators.Required('Information obligatoire'), password_validator
        ])
    retype_password = wtf.PasswordField(
        label='Confirmation du mot de passe',
        validators=[
            validators.EqualTo(
                'password', message='Les deux mots de passe sont differents')
        ])
Exemplo n.º 9
0
class ResetPasswordForm(Form):
    new_password = PasswordField('New Password',
            [validators.Required(message="Password cannot be empty"),
                validators.EqualTo('confirm', message='Passwords must match')])
    confirm = PasswordField('Repeat Password')