from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.fields import RichTextField
from wagtail.models import Page
class HomePage(Page):
image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
help_text="Image page d'accueil",
)
hero_text = models.CharField(
blank=True, max_length=1024, help_text="Phrase d'accueil"
body = RichTextField(blank=True)
content_panels = Page.content_panels + [
FieldPanel("image"),
FieldPanel("hero_text"),
FieldPanel("body"),
]