Beispiel #1
0
class CarForm(FlaskForm):
    username = TextField('Nome', validators=[DataRequired()])
    emailadr = TextField('e-mail', validators=[Email(),DataRequired()])
    hashkey = TextField('Validation Hash', validators=[DataRequired()])
    sex = RadioField('Sexo', validators=[Required()] ,
        choices=[('F', 'Feminino'), ('M', 'Masculino')])   
    perg1 = RadioField(Label, validators=[Required()] , choices=cho1)
    perg2 = RadioField(Label, validators=[Required()] , choices=cho2)
    perg3 = RadioField(Label, validators=[Required()] , choices=cho3)
    perg4 = RadioField(Label, validators=[Required()] , choices=cho4)
    perg5 = RadioField(Label, validators=[Required()] , choices=cho5)
    perg6 = RadioField(Label, validators=[Required()] , choices=cho6)
    perg7 = RadioField(Label, validators=[Required()] , choices=cho7)
    perg8 = RadioField(Label, validators=[Required()] , choices=cho8)
    perg9 = RadioField(Label, validators=[Required()] , choices=cho9)
    perg10 = RadioField(Label, validators=[Required()] , choices=cho10)
    perg11 = RadioField(Label, validators=[Required()] , choices=cho11)
    perg12 = RadioField(Label, validators=[Required()] , choices=cho12)
    perg13 = RadioField(Label, validators=[Required()] , choices=cho13)
    perg14 = RadioField(Label, validators=[Required()] , choices=cho14)
    perg15 = RadioField(Label, validators=[Required()] , choices=cho15)
    perg16 = RadioField(Label, validators=[Required()] , choices=cho16)
    perg17 = RadioField(Label, validators=[Required()] , choices=cho17)
    perg18 = RadioField(Label, validators=[Required()] , choices=cho18)
    perg19 = RadioField(Label, validators=[Required()] , choices=cho19)
    perg20 = RadioField(Label, validators=[Required()] , choices=cho20)
    perg21 = RadioField(Label, validators=[Required()] , choices=cho21)
    perg22 = RadioField(Label, validators=[Required()] , choices=cho22)
    perg23 = RadioField(Label, validators=[Required()] , choices=cho23)
    perg24 = RadioField(Label, validators=[Required()] , choices=cho24)
    perg25 = RadioField(Label, validators=[Required()] , choices=cho25)
    perg26 = RadioField(Label, validators=[Required()] , choices=cho26)
    perg27 = RadioField(Label, validators=[Required()] , choices=cho27)
    perg28 = RadioField(Label, validators=[Required()] , choices=cho28)
    perg29 = RadioField(Label, validators=[Required()] , choices=cho29)
    perg30 = RadioField(Label, validators=[Required()] , choices=cho30)
    perg31 = RadioField(Label, validators=[Required()] , choices=cho31)
    perg32 = RadioField(Label, validators=[Required()] , choices=cho32)
    perg33 = RadioField(Label, validators=[Required()] , choices=cho33)
    perg34 = RadioField(Label, validators=[Required()] , choices=cho34)
    perg35 = RadioField(Label, validators=[Required()] , choices=cho35)
    perg36 = RadioField(Label, validators=[Required()] , choices=cho36)
    perg37 = RadioField(Label, validators=[Required()] , choices=cho37)
    perg38 = RadioField(Label, validators=[Required()] , choices=cho38)
    perg39 = RadioField(Label, validators=[Required()] , choices=cho39)
    perg40 = RadioField(Label, validators=[Required()] , choices=cho40)
    
    submit = SubmitField('Enviar Respostas')
Beispiel #2
0
class PasswordResetRequestForm(FlaskForm):
    email = StringField("邮箱", validators=[Required(), Length(1, 64), Email()])
    submit = SubmitField('确认')
Beispiel #3
0
class LoginForm(Form):
    email = StringField(u'邮箱', validators=[Required(), Length(1, 64), Email()])
    password = PasswordField(u'密码', validators=[Required()])
    remember_me = BooleanField(u'记住我')
    submit = SubmitField(u'登录')
Beispiel #4
0
class NameForm(Form):
    name = StringField(u'姓名是什么?', validators=[Required()])
    submit = SubmitField(u'提交')
Beispiel #5
0
class CommentForm(Form):
    body = StringField(u'输入您的评论', validators=[Required()])
    submit = SubmitField(u'提交')
Beispiel #6
0
class ReassignForm(Form):
    mentor = SelectField('Which mentor do you want to assign them to',
                         validators=[Required()],
                         coerce=int)
    submit = SubmitField('Reassign')
Beispiel #7
0
class UpdateBlogForm(FlaskForm):
    # title = StringField('Title',validators = [Required()])
    content = TextAreaField('Content', validators=[Required()])
    submit = SubmitField('submit')
Beispiel #8
0
class NameForm(FlaskForm):
    name = StringField('What is your name?', validators=[Required()])
    submit = SubmitField('Submit')
Beispiel #9
0
class NameForm(Form):
    name = StringField('你的名字?', validators=[Required()])
    submit = SubmitField('提交')
Beispiel #10
0
class PostForm(FlaskForm):
    body = PageDownField("What's on your mind?", validators=[Required()])
    submit = SubmitField('Submit')
Beispiel #11
0
class CommentForm(FlaskForm):
    body = StringField('', validators=[Required()])
    submit = SubmitField('Submit')
Beispiel #12
0
class LangForm(Form):
    txtdata = TextAreaField('Text to process', validators=[Required()])
    submit = SubmitField('Process')
Beispiel #13
0
class UploadForm(FlaskForm):
    file = FileField(validators=[Required()])
    submit = SubmitField('Upload')
Beispiel #14
0
class LoginForm(Form):
    email = StringField('Email', validators=[Required(), Length(1, 64), Email()])
    password = PasswordField('Password', validators=[Required()])
    remember_me = BooleanField('Keep me logged in')
    submit = SubmitField('Log In')
Beispiel #15
0
class CommentForm(FlaskForm):

    name = StringField('Enter your comment here', validators=[Required()])

    submit = SubmitField('create')
Beispiel #16
0
class PostForm(Form):
    body = PageDownField('你的观点:', validators=[Required()])
    submit = SubmitField('提交')
Beispiel #17
0
class PostForm(FlaskForm):
    body = TextAreaField("What's on your mind?", validators=[Required()])

    submit = SubmitField('submit')
Beispiel #18
0
class CommentForm(FlaskForm):    
    details = TextAreaField('Leave your comment', validators=[Required()])
Beispiel #19
0
class UpdateProfile(FlaskForm):
    title = StringField('Title', validators=[Required()])
    bio = TextAreaField('Tell us about you.', validators=[Required()])
    submit = SubmitField('Submit')
Beispiel #20
0
class CreateEventForm(Form):
    """A form for the creation of a :class:`~app.models.Event` object.

    :ivar title: :class:`wtforms.fields.StringField` - The title of the event.
    :ivar slug: :class:`wtforms.fields.StringField` - A unique url fragment for
        this blog post. This may only contain letters, numbers, and dashes
        (``-``).
    :ivar location: :class:`wtforms.fields.StringField` - The location of the
        event.
    :ivar start_date: :class:`wtforms.fields.DateField` - The date the event
        starts on.
    :ivar end_date: :class:`wtforms.fields.DateField` - The date the event
        ends on.
    :ivar start_time: :class:`TimeField` - The time the event starts.
    :ivar end_time: :class:`TimeField` - The time the event ends.
    :ivar is_recurring: :class:`wtforms.fields.BooleanField` - True if the
        event is recurring.
    :ivar frequency: :class:`wtforms.fields.SelectField` - The interval of the
        occurrence. Can only take the value ``"weekly"``.
    :ivar every: :class:`wtforms.fields.IntegerField` - The number of
        ``frequency`` units after which the event repeats. For example,
        ``frequency = "weekly"`` and ``every = 2`` indicates that the event
        occurs every two weeks.
    :ivar ends: :class:`wtforms.fields.RadioField` - ``"after"`` if the event
        ends after ``num_occurrences`` occurrences, or ``"on"`` if the date
        ends on ``recurrence_end_date``.
    :ivar num_occurrences: :class:`wtforms.fields.IntegerField` - The number of
        occurrences for a recurring event.  Should be set only if ``ends`` is
        set to ``"after"``.
    :ivar recurrence_end_date: :class:`wtforms.fields.DateField` - The date
        that the recurrence ends on.  Should be set only if ``ends`` is set to
        ``"on"``.
    :ivar recurrence_summary: :class:`wtforms.fields.StringField` - A plain
        English explanation of the recurrence. Generated in JavaScript but
        stored here.
    :ivar short_description: :class:`wtforms.fields.TextAreaField` - The
        markdown text of the short description for the event.
    :ivar long_description: :class:`wtforms.fields.TextAreaField` - The
        markdown text of the long description for the event.
    :ivar published: :class:`wtforms.fields.BooleanField` - True if the event
        is published.
    :ivar facebook_url: :class:`wtforms.fields.StringField` - The URL of the
        associated Facebook event.
    :ivar event_image: :class:`wtforms.fields.StringField` - The filename of
        the headline image.
    """

    title = StringField('Title',
                        [Required(message="Please provide an event title.")])
    slug = StringField('Slug', [UniqueEvent(),
                                Regexp(Regex.SLUG_REGEX,
                                       message=INVALID_SLUG)])
    location = StringField('Location')
    start_date = DateField('Start date', [Optional()], format=DATE_FORMAT)
    start_time = TimeField('Start time', [Optional()])
    end_date = DateField('End date', [Optional()], format=DATE_FORMAT)
    end_time = TimeField('End time', [Optional()])
    is_recurring = BooleanField('Is Recurring')
    frequency = SelectField('Repeats', choices=[('weekly', 'Weekly')],
                            default="weekly")
    every = IntegerField('Every', [NumberRange(min=1, max=30)], default=1)
    ends = RadioField('Ends', choices=[("after", "After"), ("on", "On")],
                      default="after")
    num_occurrences = IntegerField('Every', [NumberRange(min=1)], default=1)
    recurrence_end_date = DateField('Repeat End Date', [Optional()],
                                    format=DATE_FORMAT)
    recurrence_summary = StringField('Summary')
    short_description = TextAreaField('Short description',
                                      default=SHORT_DESCRIPTION_PLACEHOLDER)
    long_description = TextAreaField('Long description',
                                     default=LONG_DESCRIPTION_PLACEHOLDER)
    published = BooleanField('Published')
    facebook_url = StringField('Facebook  URL', [Optional(), URL()])
    event_image = StringField('Image', [image_with_same_name])

    def post_validate(self, validation_stopped):
        """Make sure that the start datetime comes before the end datetime.


        :param self: The form to validate
        :type self: :class:`Form`
        :param bool validation_stopped: True if any validator raised
            :class:`~wtforms.validators.StopValidation`.
        :raises: :class:`wtforms.validators.ValidationError`
        """
        if not validation_stopped:
            start_date = self.start_date.data
            start_time = self.start_time.data
            end_date = self.end_date.data
            end_time = self.end_time.data

            # Start and end dates should be in order.
            if start_date and end_date and start_date > end_date:
                raise ValidationError("Start date should come before end date")
            if (all([start_date, start_time, end_date, end_time]) and
                    start_time > end_time):
                raise ValidationError("Start time should come before end date")
Beispiel #21
0
class CommentsForm(FlaskForm):
    #  title = StringField('Title',validators = [Required()])
    comment = TextAreaField('Comment', validators=[Required()])
    submit = SubmitField('SUBMIT')
class TweetForm(FlaskForm):
    text = StringField('Enter the text of the tweet (no more than 280 chars): ', validators= [Required(), Length(min = 1, max = 280)])
    username = StringField('Enter the username of the twitter user (no "@"!): ', validators= [Required(), Length(min = 1, max = 64)])
    display = StringField('Enter the display name for the twitter user (must be at least 2 words): ', validators= [Required()])
    submit = SubmitField("Submit")

    def validate_display(self, field):
        if len(field.data.split()) < 2:
            raise ValidationError("Name must be at least 2 words. Please enter display name again.")
    def validate_username(self, field):
        if '@' == str(field.data)[0]:
            raise ValidationError("The following entered format is incorrect. Please enter username again.")
Beispiel #23
0
class PostForm(Form):
    body = PageDownField(u"您的看法是什么?", validators=[Required()])
    submit = SubmitField(u'提交')
Beispiel #24
0
class Forgot(FlaskForm):
    ''' User forgot password form. '''

    email = TextField(validators=[Required(), Email()],
                      description='Email address')
Beispiel #25
0
class LoginForm(FlaskForm):
    email = StringField("邮箱", validators=[Required(), Length(1, 64), Email()])
    password = PasswordField("密码", validators=[Required()])
    remember_me = BooleanField("记住我")
    submit = SubmitField("登录")
Beispiel #26
0
class Login(FlaskForm):
    ''' User login form. '''

    email = TextField(validators=[Required(), Email()],
                      description='Email address')
    password = PasswordField(validators=[Required()], description='Password')
Beispiel #27
0
class ResetPasswordRequestForm(Form):
    # 重置密码第一步
    email = StringField(u'注册邮箱', validators=[Required(), Email()])
    submit = SubmitField(u'找回密码')
Beispiel #28
0
class LoginForm(FlaskForm):
    email = StringField('Your Email Address', validators=[Required(), Email()])
    password = PasswordField('Password', validators=[Required()])
    remember = BooleanField('Remember me')
    submit = SubmitField('Sign In')
Beispiel #29
0
class LoginForm(Form):
    email = StringField('Email', validators=[Required()])
    password = PasswordField('Password', validators=[Required()])
    submit = SubmitField('Login')
Beispiel #30
0
class CommentForm(FlaskForm):
    text = TextAreaField('Leave a comment:',validators=[Required()])
    submit = SubmitField('Submit')