add some basic search functionality

This commit is contained in:
2024-07-15 04:30:05 +02:00
parent 55257f3bb4
commit c935314c4f
16 changed files with 226 additions and 5 deletions

View File

@ -25,6 +25,7 @@ from wagtail.admin.panels import (
TitleFieldPanel,
)
from wagtail.models import Orderable, Page, PageManager, PageQuerySet
from wagtail.search import index
from wagtail.snippets.models import register_snippet
from associations.widgets import AssociationChooserWidget
@ -65,6 +66,8 @@ class EventIndex(Page):
),
]
search_fields = []
@register_snippet
@register_query_field("eventCategory", "eventCategories")
@ -374,6 +377,8 @@ class EventPage(Page):
),
]
search_fields = Page.search_fields + [index.SearchField("body")]
def clean(self):
super().clean()