Esempio n. 1
0
class EmailForm(Form):
    """Simple email form."""
    name = TextField("Your Name", validators=[Required()])
    recipient = TextField("Recipient's Email", validators=[Email()])
    email = TextField("Your Email", validators=[Email()])
    message = TextAreaField("Message", validators=[Required()])
    submit = SubmitField("Send Email")
Esempio n. 2
0
class SignUpForm(Form):
    ID = TextField(u'身份證字號', validators=[check_ID, NoneOf(ExistingUsersID(), u'此身份證字號已存在,請確認是否已註冊')])
    mobile_phone = TextField(u'行動電話', validators=[Regexp(r'^09\d{8}$', message=u'行動電話號碼格式不正確')])
    email = TextField(u'電子郵件', validators=[Email(u'電子郵件位址格式不正確')])
    password = PasswordField(u'密碼', validators=[Required(u'請設定密碼')])
    chk_password = PasswordField(u'確認密碼', validators=[EqualTo('password', u'兩次輸入的密碼不相符')])
    recaptcha = RecaptchaField(u'圖形驗證', validators=[check_recaptcha_filled, Recaptcha(u'輸入錯誤,請再試一遍')])
Esempio n. 3
0
class RegisterForm(Form):
    nickname = TextField(u'昵称', [Required(), Length(min=3, max=12)])
    email = TextField(u'邮件地址', [Length(min=6, max=30), Email(), email_unique])
    password = PasswordField(u'密码', [Length(min=6, max=12), Required()])
    password_confirm = PasswordField(
        u'密码确认',
        [Required(), EqualTo('password', message=u'密码必须相同')])
    captcha = TextField(u'验证码', [Required()])
Esempio n. 4
0
class ProfileForm(Form):
    photo_img = FileField(u'头像', validators=[])
    email = TextField(u'邮箱地址*', validators=[Required(), Email()])
    nickname = TextField(u'昵称*',
                         validators=[Required(),
                                     Regexp('[\w\d-]{2,20}')])
    title = TextField(u'签名*', validators=[Required(), Regexp('.{0,128}')])
    sex = RadioField(u'性别*', coerce=int, choices=[(0, u'男人'), (1, u'女人')])
Esempio n. 5
0
class LoginForm(Form):
    email = TextField('Email', validators=[Required(), Email()])
    password = PasswordField('Password', validators=[Required()])
    idle_ttl = RadioField('Idle Session Timeout', default='tmp', choices=[
            ('tmp',  '20 minutes'),
            ('day',  '8 hours (a normal business day)'),
            ('week', '8 days (Monday to Monday)'),
            ])
    submit = SubmitField('Login')
Esempio n. 6
0
class UploadForm(Form):
    """A simple form for uploading files to Open Data Boston."""
    name = TextField('Name', validators=[Required()])
    email = TextField('Email', validators=[Email()])
    phone = TextField('Phone Number')
    file = FileField()
    title = TextField('Title')
    url = TextField('Dataset URL')
    description = TextAreaField('Description', validators=[Required()])
    submit = SubmitField('Submit')
Esempio n. 7
0
class RegisterForm(Form):
    email = TextField('Email Address', validators = [Email()])
    password = PasswordField('New Password', validators=[
            Required(),
            Length(min=8, max=80),
            EqualTo('confirm', message='Passwords must match')
    ])
    confirm = PasswordField('Repeat Password')
    accept_tos = BooleanField('I accept the TOS', validators = [Required()])
    timezone = QuerySelectField(get_label='name', allow_blank=True)
    submit = SubmitField('Register')
Esempio n. 8
0
class RegisterForm(Form):
    email = TextField(u'邮箱地址*', validators=[Required(), Email()])
    nickname = TextField(u'昵称*',
                         validators=[Required(),
                                     Regexp('[\w\d-]{2,20}')])
    passwd = PasswordField(u'密码*',
                           validators=[Required(),
                                       Regexp('[\w\d-]{5,20}')])
    confirm = PasswordField(
        u'确认密码*', validators=[Required(),
                              EqualTo('passwd', message=u'密码不一致')])
    agree = BooleanField(u'我已经认真阅读并同意',
                         default=True,
                         validators=[BeTrue(u'同意此协议才能注册')])
Esempio n. 9
0
class RegisterForm(Form):
    fullname = TextField('Full name', validators=[Required()])
    email = TextField('Email address', validators=[Required(), Email()])
    company = TextField('Company name (or school/college)',
                        validators=[Required()])
    jobtitle = TextField('Job title', validators=[])
    twitter = TextField('Twitter id (optional)')
    referrer = SelectField('How did you hear about this event?',
                           validators=[Required()],
                           choices=REFERRERS)
    reason = TextAreaField(
        'Reasons we should pick you',
        validators=[Required()],
        default="Specifics would be good!",
    )
Esempio n. 10
0
class LoginForm(Form):
    email = TextField('Email address', validators=[Required(), Email()])
    password = PasswordField('Password', validators=[Required()])

    def getuser(self, name):
        return User.query.filter_by(email=name).first()

    def validate_username(self, field):
        existing = self.getuser(field.data)
        if existing is None:
            raise ValidationError, "No user account for that email address"
        if not existing.active:
            raise ValidationError, "This user account is disabled"

    def validate_password(self, field):
        user = self.getuser(self.email.data)
        if user is None or not user.check_password(field.data):
            raise ValidationError, "Incorrect password"
        self.user = user
Esempio n. 11
0
File: forms.py Progetto: miku/evreg
class RegistrationForm(Form):
    """
	For for manually adding a Job.
	"""
    first_name = TextField("First Name", validators=[Required()])
    last_name = TextField("Last Name", validators=[Required()])
    email = TextField("E-Mail",
                      validators=[Email(),
                                  Required(), validate_unique_email])

    password = PasswordField("Password", validators=[Required()])
    confirm = PasswordField("Confirm Password", validators=[Required()])

    dob = DateField('Date of Birth',
                    validators=[Required()],
                    format='%d.%m.%Y')
    identifier_id = TextField("Identifier ID", validators=[Required()])

    zipcode = TextField("Zipcode", validators=[Required()])
    city = TextField("City", validators=[Required()])
    street = TextField("Street", validators=[Required()])
    country = SelectField("Country",
                          choices=COUNTRIES,
                          validators=[Required()])
Esempio n. 12
0
File: forms.py Progetto: miku/evreg
class LoginForm(Form):
    username = TextField("E-Mail", validators=[Email(), Required()])
    password = PasswordField("Password", validators=[Required()])
Esempio n. 13
0
class LoginForm(Form):
    email = TextField(u'邮箱地址', validators=[Required(), Email()])
    passwd = PasswordField(u'密码',
                           validators=[Required(),
                                       Regexp('[\w\d-]{5,20}')])
    auto = BooleanField(u'自动登录', default=True)
Esempio n. 14
0
class ExampleForm(Form):
    """Just a simple example form."""
    name = TextField('Name', validators=[Required()])
    email = TextField('Email', validators=[Email()])
    location = TextField('Location')
    submit = SubmitField('Submit')