1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
wagtail-website-2018-spike/project/common/blocks.py

16 lines
568 B
Python
Raw Normal View History

from wagtail.core.fields import StreamField
from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
from wagtail.documents.blocks import DocumentChooserBlock
from wagtail.embeds.blocks import EmbedBlock
from wagtailmarkdown.blocks import MarkdownBlock
def build_stream_field():
return StreamField([
('document', DocumentChooserBlock()),
('image', ImageChooserBlock()),
('markdown', MarkdownBlock()),
('paragraph', blocks.RichTextBlock()),
('raw_html', blocks.RawHTMLBlock(label="Raw HTML")),
])