class MyTestForm(FormidableForm):

        name = fields.CharField(label=u'Name', accesses={'jedi': 'REQUIRED'})
        birth_date = fields.DateField(
            label='Your Birth Date',
            validators=[
                validators.AgeAboveValidator(
                    21, message=u'You cannot be a jedi until your 21'),
                validators.DateIsInFuture(False)
            ],
            accesses={'jedi': 'REQUIRED'},
        )
        out_date = fields.DateField(
            validators=[validators.DateIsInFuture(True)])
        weapons = fields.ChoiceField(
            choices=[('gun', 'blaster'), ('sword', 'light saber')])
        salary = fields.IntegerField(validators=[
            validators.GTValidator(0),
            validators.LTEValidator(25)
        ],
                                     accesses={
                                         'jedi': 'HIDDEN',
                                         'jedi-master': 'REQUIRED'
                                     })
예제 #2
0
        class MyForm(FormidableForm):

            mynumber = fields.IntegerField(
                label=u'number', validators=[validators.LTValidator(5)])
예제 #3
0
 class MyForm(FormidableForm):
     number_children = fields.IntegerField(label='Your Children Number')