import logging from django.db import models from wagtail.admin.edit_handlers import FieldPanel, TabbedInterface, ObjectList from core.wagtail_utils import StrictHierarchyPage logger = logging.getLogger(__name__) class Chapter(StrictHierarchyPage): class Meta: verbose_name = 'Kapitel' verbose_name_plural = 'Kapitel' description = models.TextField(blank=True) content_panels = [ FieldPanel('title', classname="full title"), FieldPanel('description', classname="full description"), ] settings_panels = [ FieldPanel('slug') ] edit_handler = TabbedInterface([ ObjectList(content_panels, heading='Content'), ObjectList(settings_panels, heading='Settings'), ]) template = 'generic_page.html' parent_page_types = ['book.Module'] subpage_types = ['book.ContentBlock']