Enter code here...from __future__ import unicode_literals
from wagtail.wagtailcore import blocks
from wagtail.wagtailcore.blocks import *
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import RichTextField, StreamField
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.wagtailimages.blocks import ImageChooserBlock
from django import forms
class PageN(FieldBlock):
field = forms.ChoiceField(choices=(
('/about/', "About Us"),
('/recruitment/', "Recruitment"),
('/brothers', "Brothers"),
('/alumni/', "Alumni"),
('/contact/', "Contact Us")
))
class PersonBlock(blocks.StreamBlock):
carousel = blocks.StructBlock([
(('image'), ImageChooserBlock()),
(('title'), blocks.CharBlock(max_length=120, blank=True, null=True, default='Title')),
(('subtext'), blocks.CharBlock(max_length=120, blank=True, null=True, default='none')),
(('link'), PageN()),
])
class HomePage(Page):
body = RichTextField(blank=True)
carousel = StreamField(PersonBlock())
HomePage.content_panels = [
FieldPanel('title'),
StreamFieldPanel('carousel'),
FieldPanel('body'),
]