Search indexing

This commit is contained in:
Oleg Lavrovsky 2017-05-03 23:13:30 +02:00
parent 2913344224
commit 8c6eedf232
2 changed files with 9 additions and 6 deletions

View file

@ -45,6 +45,9 @@ release:
docker-compose kill web docker-compose kill web
docker-compose up -d web docker-compose up -d web
reindex:
docker-compose exec web ./manage.py update_index
django-exec-bash: django-exec-bash:
# execute bash in the currently running container # execute bash in the currently running container
docker-compose exec web bash docker-compose exec web bash

View file

@ -2,16 +2,16 @@
from modelcluster.fields import ParentalKey from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, FieldRowPanel,
InlinePanel, MultiFieldPanel
)
from django.db.models import CharField from django.db.models import CharField
from wagtail.wagtailcore.fields import RichTextField from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailforms.models import ( from wagtail.wagtailforms.models import (
AbstractEmailForm, AbstractFormField AbstractEmailForm, AbstractFormField
) )
from wagtail.wagtailadmin.edit_handlers import (
FieldPanel, FieldRowPanel,
InlinePanel, MultiFieldPanel
)
from wagtail.wagtailsearch import index from wagtail.wagtailsearch import index
from ..util import TranslatedField from ..util import TranslatedField
@ -19,7 +19,7 @@ from ..util import TranslatedField
class ContactFormField(AbstractFormField): class ContactFormField(AbstractFormField):
page = ParentalKey('ContactForm', related_name='form_fields') page = ParentalKey('ContactForm', related_name='form_fields')
class ContactForm(AbstractEmailForm): class ContactForm(AbstractEmailForm, index.Indexed):
intro = RichTextField(default='', blank=True) intro = RichTextField(default='', blank=True)
thanks = RichTextField(default='', blank=True) thanks = RichTextField(default='', blank=True)