当前位置: 首页>>代码示例>>Python>>正文


Python fields.StreamField方法代码示例

本文整理汇总了Python中wagtail.wagtailcore.fields.StreamField方法的典型用法代码示例。如果您正苦于以下问题:Python fields.StreamField方法的具体用法?Python fields.StreamField怎么用?Python fields.StreamField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块wagtail.wagtailcore.fields的用法示例。

在下文中一共展示了fields.StreamField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_page_blocks

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def get_page_blocks(page):
    blocks = []

    for field in page.specific._meta.fields:
        if not isinstance(field, StreamField):
            continue

        for stream_child in getattr(page.specific, field.name):
            blocks.extend(get_field_blocks(stream_child))

    return sorted(set(map(get_block_name, blocks))) 
开发者ID:cfpb,项目名称:wagtail-inventory,代码行数:13,代码来源:helpers.py


示例2: test_body

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def test_body(self):
        field = CustomContent._meta.get_field('body')
        self.assertModelField(field, StreamField, True, True, None)

    # meta 
开发者ID:AccentDesign,项目名称:django_wagtail_boilerplate,代码行数:7,代码来源:test_snippet_custom_content.py


示例3: test_content

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def test_content(self):
        field = AbstractCard._meta.get_field('content')
        self.assertModelField(field, StreamField, False, False) 
开发者ID:AccentDesign,项目名称:django_wagtail_boilerplate,代码行数:5,代码来源:test_abstract_card.py


示例4: test_content

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def test_content(self):
        field = AbstractSectionItem._meta.get_field('content')
        self.assertModelField(field, StreamField, True, True) 
开发者ID:AccentDesign,项目名称:django_wagtail_boilerplate,代码行数:5,代码来源:test_abstract_section.py


示例5: test_left_content

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def test_left_content(self):
        field = TwoColumn._meta.get_field('left_content')
        self.assertModelField(field, StreamField, False, False, None) 
开发者ID:AccentDesign,项目名称:django_wagtail_boilerplate,代码行数:5,代码来源:test_snippet_two_column.py


示例6: test_right_content

# 需要导入模块: from wagtail.wagtailcore import fields [as 别名]
# 或者: from wagtail.wagtailcore.fields import StreamField [as 别名]
def test_right_content(self):
        field = TwoColumn._meta.get_field('right_content')
        self.assertModelField(field, StreamField, False, False, None)

    # meta 
开发者ID:AccentDesign,项目名称:django_wagtail_boilerplate,代码行数:7,代码来源:test_snippet_two_column.py



注:本文中的wagtail.wagtailcore.fields.StreamField方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。