From 8c6eedf232010b17254f6439b359b7d88a91c474 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Wed, 3 May 2017 23:13:30 +0200 Subject: [PATCH] Search indexing --- Makefile | 3 +++ publichealth/home/models/forms.py | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 01291f0..c51ded1 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,9 @@ release: docker-compose kill web docker-compose up -d web +reindex: + docker-compose exec web ./manage.py update_index + django-exec-bash: # execute bash in the currently running container docker-compose exec web bash diff --git a/publichealth/home/models/forms.py b/publichealth/home/models/forms.py index d0d2072..450148e 100644 --- a/publichealth/home/models/forms.py +++ b/publichealth/home/models/forms.py @@ -2,16 +2,16 @@ from modelcluster.fields import ParentalKey -from wagtail.wagtailadmin.edit_handlers import ( - FieldPanel, FieldRowPanel, - InlinePanel, MultiFieldPanel -) - from django.db.models import CharField + from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailforms.models import ( AbstractEmailForm, AbstractFormField ) +from wagtail.wagtailadmin.edit_handlers import ( + FieldPanel, FieldRowPanel, + InlinePanel, MultiFieldPanel +) from wagtail.wagtailsearch import index from ..util import TranslatedField @@ -19,7 +19,7 @@ from ..util import TranslatedField class ContactFormField(AbstractFormField): page = ParentalKey('ContactForm', related_name='form_fields') -class ContactForm(AbstractEmailForm): +class ContactForm(AbstractEmailForm, index.Indexed): intro = RichTextField(default='', blank=True) thanks = RichTextField(default='', blank=True)