Skip to content
Snippets Groups Projects
Unverified Commit 103bf968 authored by Todd Dembrey's avatar Todd Dembrey Committed by GitHub
Browse files

Merge pull request #475 from OpenTechFund/feature/update-search-indexes

Feature/update search indexes
parents 765a2307 686f290a
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ from wagtail.admin.edit_handlers import (
)
from wagtail.core.fields import StreamField
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtail.search import index
from opentech.public.utils.models import (
BasePage,
......@@ -43,6 +44,11 @@ class BaseApplicationPage(BasePage):
)
body = StreamField(FundBlock())
search_fields = BasePage.search_fields + [
index.SearchField('introduction'),
index.SearchField('body')
]
content_panels = BasePage.content_panels + [
FieldPanel('introduction'),
StreamFieldPanel('body'),
......@@ -129,6 +135,11 @@ class LabPage(BasePage):
link_text = models.CharField(max_length=255, help_text='Text to display on the button for external links', blank=True)
body = StreamField(LabBlock())
search_fields = BasePage.search_fields + [
index.SearchField('introduction'),
index.SearchField('body')
]
content_panels = BasePage.content_panels + [
ImageChooserPanel('icon'),
FieldPanel('introduction'),
......
......@@ -16,6 +16,7 @@ from wagtail.admin.edit_handlers import (
StreamFieldPanel
)
from wagtail.images.edit_handlers import ImageChooserPanel
from wagtail.search import index
from opentech.public.utils.blocks import StoryBlock
from opentech.public.utils.models import BasePage, BaseFunding, FundingMixin, RelatedPage
......@@ -146,6 +147,11 @@ class PersonPage(FundingMixin, BasePage):
biography = StreamField(StoryBlock(), blank=True)
email = models.EmailField(blank=True)
search_fields = BasePage.search_fields + [
index.SearchField('introduction'),
index.SearchField('biography')
]
content_panels = BasePage.content_panels + [
MultiFieldPanel([
FieldPanel('first_name'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment