1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/project/pages/models.py

25 lines
702 B
Python
Raw Normal View History

2016-11-28 21:36:11 +00:00
from django.db import models
2016-12-08 11:15:05 +00:00
from project.common.fields import build_stream_field
2016-11-28 21:36:11 +00:00
from project.common.models import Entity
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import RichTextField
2016-12-08 11:15:05 +00:00
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel
2016-11-28 21:36:11 +00:00
class SimpleContentPage(Entity):
2016-12-08 11:15:05 +00:00
body = build_stream_field()
2016-11-28 21:36:11 +00:00
content_panels = Page.content_panels + [
2016-12-08 11:15:05 +00:00
StreamFieldPanel('body')
2016-11-28 21:36:11 +00:00
]
2016-11-28 21:58:34 +00:00
2016-11-28 21:36:11 +00:00
class SectionIndexPage(Entity):
intro = RichTextField(blank=True)
hide_list = models.BooleanField(default=False)
content_panels = Page.content_panels + [
FieldPanel('intro', classname="full"),
FieldPanel('hide_list')
]