Ejemplo n.º 1
0
class MultipleChoicesConditionsTestForm(FormidableForm):
    main_choices = fields.MultipleChoiceField(
        choices=(
            ('a', 'A'),
            ('b', 'B'),
            ('no_condition', 'No_condition')
        ),
        accesses={'padawan': constants.EDITABLE}
    )
    a = fields.CharField(accesses={'padawan': constants.EDITABLE})
    b = fields.CharField(accesses={'padawan': constants.EDITABLE})
    c = fields.CharField(accesses={'padawan': constants.EDITABLE})
Ejemplo n.º 2
0
 class MultipleChoiceForm(FormidableForm):
     main_choices = fields.MultipleChoiceField(
         choices=(
             ('first', 'First'),
             ('second', 'Second'),
             ('third', 'Third'),
         ),
         accesses={'padawan': constants.EDITABLE})
     first_field = fields.CharField(
         accesses={'padawan': constants.EDITABLE})
     second_field = fields.CharField(
         accesses={'padawan': constants.EDITABLE})
     third_field = fields.CharField(
         accesses={'padawan': constants.EDITABLE})
     another_field = fields.CharField(
         accesses={'padawan': constants.EDITABLE})
Ejemplo n.º 3
0
class AccessesTestCaseTestForm(FormidableForm):
    editable_text = fields.CharField(label='Editable text',
                                     accesses={'jedi': constants.EDITABLE},
                                     default='Default value (editable)')
    readonly_text = fields.CharField(label='Readonly text',
                                     accesses={'jedi': constants.READONLY},
                                     default='Default value (readonly)')
    readonly_dropdown = fields.MultipleChoiceField(
        label='Readonly dropdown',
        accesses={'jedi': constants.READONLY},
        defaults=['val1', 'val2'],
        choices=[('val1', 'Default value 1 (readonly)'),
                 ('val2', 'Default value 2 (readonly)'), ('val3', 'Value 3')])
    hidden_field = fields.CharField(label='Hidden text',
                                    accesses={'jedi': constants.HIDDEN},
                                    default='Default value (hidden)')
        class TestCheckboxesField(FormidableForm):

            checkboxesinput = fields.MultipleChoiceField(
                widget=widgets.CheckboxSelectMultiple,
                choices=choices,
            )
Ejemplo n.º 5
0
        class MyForm(FormidableForm):

            checkboxinput = fields.MultipleChoiceField(
                label='Beers ?', choices=choices,
                widget=widgets.CheckboxSelectMultiple
            )
Ejemplo n.º 6
0
 class MyForm(FormidableForm):
     mydropdown = fields.MultipleChoiceField(label='Weapons', choices=(
         ('GUN', 'eagle'), ('SWORD', 'Andúril'))
     )