Skip to content
Snippets Groups Projects
models.py 897 B
Newer Older
  • Learn to ignore specific revisions
  • from django.db import models
    
    from wagtail.wagtailadmin.edit_handlers import FieldPanel
    from wagtail.wagtailcore.models import Page
    from wagtail.wagtailsearch import index
    from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
    
    Todd Dembrey's avatar
    Todd Dembrey committed
    
    
    from opentech.utils.models import SocialFields, ListingFields
    
    
    class ApplyHomePage(Page, SocialFields, ListingFields):
        # Only allow creating HomePages at the root level
        parent_page_types = ['wagtailcore.Page']
    
        strapline = models.CharField(blank=True, max_length=255)
    
        search_fields = Page.search_fields + [
            index.SearchField('strapline'),
        ]
    
        content_panels = Page.content_panels + [
            FieldPanel('strapline'),
        ]
    
        promote_panels = (
            Page.promote_panels +
            SocialFields.promote_panels +
            ListingFields.promote_panels
        )
    
    
    class FundPage(Page):
        parent_page_types = [ApplyHomePage]