add support for generic pages
This commit is contained in:
26
dnscms/generic/models.py
Normal file
26
dnscms/generic/models.py
Normal file
@ -0,0 +1,26 @@
|
||||
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"),
|
||||
]
|
Reference in New Issue
Block a user