當前位置: 首頁>>代碼示例>>Python>>正文


Python blocks.BooleanBlock方法代碼示例

本文整理匯總了Python中wagtail.core.blocks.BooleanBlock方法的典型用法代碼示例。如果您正苦於以下問題:Python blocks.BooleanBlock方法的具體用法?Python blocks.BooleanBlock怎麽用?Python blocks.BooleanBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wagtail.core.blocks的用法示例。


在下文中一共展示了blocks.BooleanBlock方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_form_block

# 需要導入模塊: from wagtail.core import blocks [as 別名]
# 或者: from wagtail.core.blocks import BooleanBlock [as 別名]
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,
        ) 
開發者ID:labd,項目名稱:wagtailstreamforms,代碼行數:19,代碼來源:fields.py

示例2: get_form_block

# 需要導入模塊: from wagtail.core import blocks [as 別名]
# 或者: from wagtail.core.blocks import BooleanBlock [as 別名]
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) 
開發者ID:labd,項目名稱:wagtailstreamforms,代碼行數:11,代碼來源:wagtailstreamforms_fields.py

示例3: get_form_block

# 需要導入模塊: from wagtail.core import blocks [as 別名]
# 或者: from wagtail.core.blocks import BooleanBlock [as 別名]
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,
        ) 
開發者ID:labd,項目名稱:wagtailstreamforms,代碼行數:14,代碼來源:wagtailstreamforms_fields.py


注:本文中的wagtail.core.blocks.BooleanBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。