from django.db import models from modelcluster.fields import ParentalKey from wagtail.core.models import Page, Orderable from wagtail.core.fields import RichTextField from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.admin.edit_handlers import FieldPanel, InlinePanel class HomePage(Page): body = RichTextField(blank=True) image = models.ForeignKey( 'wagtailimages.Image', on_delete=models.PROTECT, null=True, related_name='+' ) content_panels = Page.content_panels + [ FieldPanel('body', classname="full"), ImageChooserPanel('image'), ]