Exemplo n.º 1
0
class MyTestForm(FormidableForm):
    name = fields.CharField(label='Name', accesses={'jedi': 'REQUIRED'})
    birth_date = fields.DateField(
        label='Your Birth Date',
        validators=[
            validators.AgeAboveValidator(
                21, message='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.NumberField(
        validators=[validators.GTValidator(0),
                    validators.LTEValidator(25)],
        accesses={
            'jedi': 'HIDDEN',
            'jedi-master': 'REQUIRED'
        })
 class TestdateField(FormidableForm):
     """ Test date """
     date = fields.DateField(validators=[AgeAboveValidator(21)])
 class TestdateField(FormidableForm):
     """ Test date """
     date = fields.DateField()
Exemplo n.º 4
0
        class MyForm(FormidableForm):

            dateinput = fields.DateField(label='Birth Date')
Exemplo n.º 5
0
        class MyForm(FormidableForm):

            mydate = fields.DateField(
                validators=[validators.AgeUnderValidator(21)]
            )
Exemplo n.º 6
0
        class MyForm(FormidableForm):

            mydate = fields.DateField(
                validators=[validators.DateIsInFuture(False)]
            )