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 migdal.models import Entry
8 class EntryIndex(indexes.SearchIndex, indexes.Indexable):
9 text = indexes.CharField(null=True,
10 model_attr=localize_field('body', settings.LANGUAGE_CODE),
12 date = indexes.DateTimeField(indexed=True, model_attr="date")
13 author = indexes.CharField(model_attr="author")
19 add_translatable_index(EntryIndex, {
20 'title': indexes.CharField(null=True),
21 'lead': indexes.CharField(null=True),
24 add_translatable_index(EntryIndex, {
25 'title': indexes.CharField(null=True),
26 'lead': indexes.CharField(null=True),
27 'body': indexes.CharField(null=True)
29 (lang for lang in settings.LANGUAGES if lang[0] != settings.LANGUAGE_CODE)