コード例 #1
0
class RegistrationForm(Form):
    username = TextField(u'Введите логин', [validators.Length(min=4, max=25)])
    password = PasswordField(u'Введите пароль', [
        validators.Required(),
        validators.EqualTo('confirm', message=u'Пароли должны совпадать')
    ])
    confirm = PasswordField(u'Повторите Ваш пароль еще раз')
コード例 #2
0
class AddEventForm(FlaskForm):
    description = StringField('Name of Event',
                              validators=[validators.Length(min=4, max=25)])
    organizer = SelectField('Organizer', coerce=int)
    venue = StringField('Place of Event')
    start_time = DateTimeField('Starting from', format="%d-%m-%y")
    end_time = DateTimeField('Ending at', format="%d-%m-%y")
    submit = SubmitField('Add Event')
コード例 #3
0
ファイル: register.py プロジェクト: cryptobuks/freelan-server
class RegisterForm(Form):
    """
    The register form.
    """
    username = TextField('Username', [validators.Required(), validators.Length(min=1, max=80), username_check])
    password = PasswordField('Password', [validators.Required()])
    password_repeat = PasswordField('Repeat password', [validators.EqualTo('password', message='Passwords must match.')])
    email = EmailField('Email', [validators.Required(), email_check])
    recaptcha = RecaptchaField()
コード例 #4
0
ファイル: network.py プロジェクト: cryptobuks/freelan-server
class NetworkForm(Form):
    """
    The network form.
    """
    name = TextField('Name',
                     [validators.Required(),
                      validators.Length(min=1, max=80)])
    ipv4_address = IPTextField('IPv4 network', ip_version=4, network_only=True)
    ipv6_address = IPTextField('IPv6 network', ip_version=6, network_only=True)
    members = FieldList(FormField(NetworkMemberForm))
コード例 #5
0
ファイル: login.py プロジェクト: cryptobuks/freelan-server
class LoginForm(Form):
    """
    The login form.
    """
    username = TextField(
        'Username',
        [validators.InputRequired(),
         validators.Length(min=1, max=80)])
    password = PasswordField('Password', [validators.InputRequired()])
    recaptcha = RecaptchaField()
    remember_me = BooleanField('Remember me')
コード例 #6
0
class RegistrationForm(Form):

    login = StringField(
        'Login', [validators.Length(min=4, max=25),
                  validators.DataRequired()])

    password = PasswordField('Password', [
        validators.DataRequired(),
        validators.EqualTo('verification', message='Passwords must match')
    ])

    full_name = StringField('Full name', [validators.DataRequired()])

    verification = PasswordField('Repeat password',
                                 [validators.DataRequired()])

    email = StringField('Email', [
        validators.Length(min=6, max=35),
        validators.Email(),
        validators.DataRequired()
    ])
コード例 #7
0
ファイル: user.py プロジェクト: cryptobuks/freelan-server
class UserForm(Form):
    """
    The user form.
    """
    username = TextField(
        'Username', [validators.Required(),
                     validators.Length(min=1, max=80)])
    current_password = PasswordField('Current password',
                                     [validators.Optional()])
    new_password = PasswordField('New password', [validators.Optional()])
    new_password_repeat = PasswordField(
        'Repeat new password',
        [validators.EqualTo('new_password', message='Passwords must match.')])
    email = EmailField('Email', [validators.Required()])
    networks = FieldList(FormField(UserMemberForm))
    admin_flag = BooleanField('Has administrative privileges')
コード例 #8
0
class LoginForm(Form):
    email = TextField('Email', [validators.Length(min=6, max=35), validators.Email()])
    password = PasswordField('Password', [Required()])
コード例 #9
0
class RegistrationForm(Form):
    name = TextField('Name', [validators.Length(min=1, max=25)])
    email = TextField('Email', [validators.Length(min=6, max=35), validators.Email()])
    password = PasswordField('Password', [Required()])
コード例 #10
0
class AskQuestionForm(Form):
    question = TextField(u'Введите вопрос', [validators.Length(min=10, max=128)])