49 lignes
1.2 KiB
Python
49 lignes
1.2 KiB
Python
from wagtail.core.models import Page
|
|
from wagtail.core.fields import RichTextField, StreamField
|
|
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
|
|
from wagtail.images.edit_handlers import ImageChooserPanel
|
|
# from wagtail.contrib.settings.models import BaseSetting, register_setting
|
|
|
|
import weo.models
|
|
|
|
|
|
class SitePage(Page):
|
|
|
|
class Meta:
|
|
verbose_name = "page"
|
|
|
|
### Contraintes de structure
|
|
### ------------------------
|
|
|
|
subpage_types = ['SitePage']
|
|
parent_page_types = ['Espace', 'Accueil', 'SitePage']
|
|
|
|
### Body
|
|
### ----
|
|
|
|
image_en_tete = weo.models.ImageEnTete(blank=True)
|
|
contenu = StreamField(
|
|
[('contenu_bloc', weo.models.ContenuBloc())],
|
|
blank=True)
|
|
|
|
content_panels = Page.content_panels + [
|
|
ImageChooserPanel('image_en_tete'),
|
|
StreamFieldPanel('contenu'),
|
|
]
|
|
|
|
### Promotion
|
|
### ---------
|
|
|
|
### Réglages
|
|
### --------
|
|
|
|
class Espace(SitePage):
|
|
bling = RichTextField(blank=True)
|
|
content_panels = SitePage.content_panels + [
|
|
FieldPanel('bling'),
|
|
]
|
|
|
|
|
|
class Accueil(SitePage):
|
|
parent_page_types = [Page]
|