Wagtail 3 changes
This commit is contained in:
committed by
nick.moreton
parent
dd4530203f
commit
c7eaec1315
@@ -1,26 +1,33 @@
|
||||
from django.db import models
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.core.models import Page
|
||||
from wagtail import VERSION as WAGTAIL_VERSION
|
||||
|
||||
if WAGTAIL_VERSION >= (3, 0):
|
||||
from wagtail.admin.panels import FieldPanel
|
||||
from wagtail.fields import RichTextField
|
||||
from wagtail.models import Page
|
||||
else:
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.core.models import Page
|
||||
|
||||
from wagtail_personalisation.models import PersonalisablePageMixin
|
||||
|
||||
|
||||
class RegularPage(Page):
|
||||
subtitle = models.CharField(max_length=255, blank=True, default='')
|
||||
body = RichTextField(blank=True, default='')
|
||||
subtitle = models.CharField(max_length=255, blank=True, default="")
|
||||
body = RichTextField(blank=True, default="")
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel('subtitle'),
|
||||
FieldPanel('body'),
|
||||
FieldPanel("subtitle"),
|
||||
FieldPanel("body"),
|
||||
]
|
||||
|
||||
|
||||
class ContentPage(PersonalisablePageMixin, Page):
|
||||
subtitle = models.CharField(max_length=255, blank=True, default='')
|
||||
body = RichTextField(blank=True, default='')
|
||||
subtitle = models.CharField(max_length=255, blank=True, default="")
|
||||
body = RichTextField(blank=True, default="")
|
||||
|
||||
content_panels = Page.content_panels + [
|
||||
FieldPanel('subtitle'),
|
||||
FieldPanel('body'),
|
||||
FieldPanel("subtitle"),
|
||||
FieldPanel("body"),
|
||||
]
|
||||
|
Reference in New Issue
Block a user