feat(pages): ajoute le body à l'index de recherche
Parent
f55b996341
révision
e092592423
|
@ -2,6 +2,7 @@ from django.db import models
|
|||
from django.db.models.functions import Coalesce
|
||||
|
||||
from wagtail.core.fields import StreamField
|
||||
from wagtail.search import index
|
||||
|
||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||
from modelcluster.fields import ParentalKey
|
||||
|
@ -59,6 +60,9 @@ class ArticlePage(AbstractBasePage):
|
|||
|
||||
parent_page_types = ['blog.BlogPage']
|
||||
subpage_types = []
|
||||
search_fields = AbstractBasePage.search_fields + [
|
||||
index.SearchField('body', partial_match=True),
|
||||
]
|
||||
|
||||
@property
|
||||
def date(self):
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.utils.safestring import mark_safe
|
|||
|
||||
from wagtail.contrib.settings.models import BaseSetting, register_setting
|
||||
from wagtail.core.fields import RichTextField, StreamField
|
||||
from wagtail.search import index
|
||||
|
||||
from wagtail_cblocks.blocks import ButtonBlock, Style
|
||||
from wagtail_webradio.blocks import PodcastTagChooserBlock
|
||||
|
@ -32,6 +33,10 @@ class StandardPage(AbstractBasePage):
|
|||
|
||||
body = StreamField(BodyBlock, blank=True, verbose_name="contenu de la page")
|
||||
|
||||
search_fields = AbstractBasePage.search_fields + [
|
||||
index.SearchField('body', partial_match=True)
|
||||
]
|
||||
|
||||
|
||||
class HomePage(AbstractBasePage):
|
||||
class Meta:
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket