from django.db import models from wagtail.images.models import Image from wagtail.admin.edit_handlers import InlinePanel class BlogPage(models.Model): body = RichTextField() images = models.ManyToManyField(Image, blank=True) content_panels = [ FieldPanel('title'), FieldPanel('body'), InlinePanel('images', label="Images") ]
from django.db import models from wagtail.core.models import Page from wagtail.admin.edit_handlers import InlinePanel class HomePage(Page): body = RichTextField() content_panels = Page.content_panels + [ FieldPanel('body'), InlinePanel('child_pages', label="Child Pages") ] class ChildPage(Page): parent_page_types = ['home.HomePage'] content_panels = Page.content_panels + [ FieldPanel('body') ]In this example, we are adding an InlinePanel to the HomePage model to allow for the inline management of child pages related to the home page. Package Library: Wagtail (https://docs.wagtail.io/en/stable/reference/pages/panels.html#wagtail.admin.edit_handlers.InlinePanel)