make a common stream field, support all block types everywhere

This commit is contained in:
2024-05-20 22:42:30 +02:00
parent e88aa5e142
commit a7e83a3163
11 changed files with 117 additions and 61 deletions

View File

@ -15,7 +15,6 @@ from grapple.models import (
)
from modelcluster.fields import ParentalKey, ParentalManyToManyField
from modelcluster.models import ClusterableModel
from wagtail import blocks
from wagtail.admin.panels import (
FieldPanel,
FieldRowPanel,
@ -25,11 +24,10 @@ from wagtail.admin.panels import (
PageChooserPanel,
TitleFieldPanel,
)
from wagtail.fields import StreamField
from wagtail.images.blocks import ImageChooserBlock
from wagtail.models import Orderable, Page, PageManager, PageQuerySet
from wagtail.snippets.models import register_snippet
from dnscms.fields import CommonStreamField
from venues.models import VenuePage
@ -154,12 +152,7 @@ class EventPage(Page):
),
)
body = StreamField(
[
("paragraph", blocks.RichTextBlock()),
("image", ImageChooserBlock()),
]
)
body = CommonStreamField
categories = ParentalManyToManyField(
"events.EventCategory",