2 from django.conf import settings
3 from haystack import indexes
4 from fnpdjango.utils.models.translation import add_translatable_index, localize_field
5 from events.models import Event
8 class EventIndex(indexes.SearchIndex, indexes.Indexable):
9 text = indexes.CharField(null=True,
10 model_attr=localize_field('title', settings.LANGUAGE_CODE),
17 add_translatable_index(EventIndex, {
18 'organizer': indexes.CharField(null=True),
19 'place': indexes.CharField(null=True)
22 add_translatable_index(EventIndex, {
23 'title': indexes.CharField(null=True),
25 (lang for lang in settings.LANGUAGES if lang[0] != settings.LANGUAGE_CODE)