Archived
1
Fork 0
This repository has been archived on 2024-10-15. You can view files and clone it, but cannot push or open issues or pull requests.
lps-wagtail/lps/home/models.py

25 lines
665 B
Python

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"),
]