models.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from django.db import models
  2. from wagtail.core.models import Page
  3. from wagtail.core.fields import RichTextField, StreamField
  4. from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel
  5. class HomePage(Page):
  6. body = RichTextField(blank=True)
  7. content_panels = Page.content_panels + [
  8. FieldPanel('body', classname="full")
  9. ]
  10. class ProjectPage(Page):
  11. author = models.TextField(blank=True)
  12. keywords = models.TextField(blank=True)
  13. objectives = RichTextField(blank=True)
  14. estimations = RichTextField(blank=True)
  15. period = models.TextField(blank=True)
  16. budget = models.TextField(blank=True)
  17. body = RichTextField(blank=True)
  18. content_panels = Page.content_panels + [
  19. MultiFieldPanel([
  20. FieldPanel('author'),
  21. FieldPanel('keywords'),
  22. FieldPanel('objectives'),
  23. FieldPanel('estimations'),
  24. FieldPanel('period'),
  25. FieldPanel('budget')], 'Meta data'
  26. ),
  27. FieldPanel('body', classname="full")
  28. ]