Files
neuf-www/dnscms/generic/models.py

27 lines
628 B
Python

from grapple.models import GraphQLStreamfield
from wagtail import blocks
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
from wagtail.images.blocks import ImageChooserBlock
from wagtail.models import Page
class GenericPage(Page):
subpage_types = ["generic.GenericPage"]
show_in_menus = True
body = StreamField(
[
("paragraph", blocks.RichTextBlock()),
("image", ImageChooserBlock()),
]
)
content_panels = Page.content_panels + [
FieldPanel("body"),
]
graphql_fields = [
GraphQLStreamfield("body"),
]