add support for previewing pages
This commit is contained in:
@@ -30,6 +30,7 @@ from wagtail.fields import RichTextField
|
||||
from wagtail.models import Orderable, Page, PageManager, PageQuerySet
|
||||
from wagtail.search import index
|
||||
from wagtail.snippets.models import register_snippet
|
||||
from wagtail_headless_preview.models import HeadlessMixin
|
||||
|
||||
from associations.widgets import AssociationChooserWidget
|
||||
from dnscms.fields import CommonStreamField
|
||||
@@ -39,7 +40,7 @@ from venues.models import VenuePage
|
||||
|
||||
|
||||
@register_singular_query_field("eventIndex")
|
||||
class EventIndex(Page):
|
||||
class EventIndex(HeadlessMixin, Page):
|
||||
max_count = 1
|
||||
subpage_types = ["events.EventPage"]
|
||||
|
||||
@@ -220,7 +221,7 @@ class EventPageQuerySet(PageQuerySet):
|
||||
EventPageManager = PageManager.from_queryset(EventPageQuerySet)
|
||||
|
||||
|
||||
class EventPage(WPImportedPageMixin, Page):
|
||||
class EventPage(HeadlessMixin, WPImportedPageMixin, Page):
|
||||
subpage_types = []
|
||||
parent_page_types = ["events.EventIndex"]
|
||||
show_in_menus = False
|
||||
@@ -358,7 +359,7 @@ class EventPage(WPImportedPageMixin, Page):
|
||||
GraphQLImage("featured_image"),
|
||||
GraphQLRichText("lead"),
|
||||
GraphQLStreamfield("body"),
|
||||
GraphQLString("pig"),
|
||||
GraphQLString("pig", required=True),
|
||||
GraphQLString("ticket_url"),
|
||||
GraphQLString("facebook_url"),
|
||||
GraphQLBoolean("free"),
|
||||
|
||||
Reference in New Issue
Block a user