Python wagtail.core.blocks.BooleanBlock() Examples

The following are 9 code examples of wagtail.core.blocks.BooleanBlock(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module wagtail.core.blocks , or try the search function .
Example #1
Source File: fields.py    From wagtailstreamforms with MIT License 6 votes vote down vote up
def get_form_block(self):
        """The StreamField StructBlock.

        Override this to provide additional fields in the StreamField.

        :return: The ``wagtail.core.blocks.StructBlock`` to be used in the StreamField
        """
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
                ("default_value", blocks.CharBlock(required=False)),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #2
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock([
            ('label', blocks.CharBlock()),
            ('help_text', blocks.CharBlock(required=False)),
            ('required', blocks.BooleanBlock(required=False)),
            ('regex', blocks.ChoiceBlock(choices=self.get_regex_choices())),
            ('error_message', blocks.CharBlock()),
            ('default_value', blocks.CharBlock(required=False)),
        ], icon=self.icon, label=self.label) 
Example #3
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock([
            ('label', blocks.CharBlock()),
            ('help_text', blocks.CharBlock(required=False)),
            ('required', blocks.BooleanBlock(required=False)),
        ], icon=self.icon, label=self.label) 
Example #4
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
                ("empty_label", blocks.CharBlock(required=False)),
                ("choices", blocks.ListBlock(blocks.CharBlock(label="Option"))),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #5
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
                ("choices", blocks.ListBlock(blocks.CharBlock(label="Option"))),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #6
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
                ("choices", blocks.ListBlock(blocks.CharBlock(label="Option"))),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #7
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #8
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
            ],
            icon=self.icon,
            label=self.label,
        ) 
Example #9
Source File: wagtailstreamforms_fields.py    From wagtailstreamforms with MIT License 5 votes vote down vote up
def get_form_block(self):
        return blocks.StructBlock(
            [
                ("label", blocks.CharBlock()),
                ("help_text", blocks.CharBlock(required=False)),
                ("required", blocks.BooleanBlock(required=False)),
            ],
            icon=self.icon,
            label=self.label,
        )