make a common stream field, support all block types everywhere
This commit is contained in:
@ -5,11 +5,12 @@ from grapple.models import (
|
||||
GraphQLStreamfield,
|
||||
GraphQLString,
|
||||
)
|
||||
from wagtail import blocks
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
from wagtail.fields import RichTextField, StreamField
|
||||
from wagtail.fields import RichTextField
|
||||
from wagtail.models import Page
|
||||
|
||||
from dnscms.fields import CommonStreamField
|
||||
|
||||
|
||||
class AssociationIndex(Page):
|
||||
max_count = 1
|
||||
@ -17,11 +18,7 @@ class AssociationIndex(Page):
|
||||
|
||||
lead = RichTextField(features=["bold", "italic", "link"])
|
||||
|
||||
body = StreamField(
|
||||
[
|
||||
("paragraph", blocks.RichTextBlock()),
|
||||
]
|
||||
)
|
||||
body = CommonStreamField
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel("lead", heading="Leder"),
|
||||
@ -44,11 +41,7 @@ class AssociationPage(Page):
|
||||
UTVALG = "utvalg", "Utvalg"
|
||||
|
||||
excerpt = models.TextField(max_length=512, blank=False)
|
||||
body = StreamField(
|
||||
[
|
||||
("paragraph", blocks.RichTextBlock()),
|
||||
]
|
||||
)
|
||||
body = CommonStreamField
|
||||
association_type = models.CharField(
|
||||
max_length=64, choices=AssociationType, default=AssociationType.FORENING
|
||||
)
|
||||
|
Reference in New Issue
Block a user