plateforme-corres2math/apps/participation/search_indexes.py

19 lines
506 B
Python
Raw Normal View History

from haystack import indexes
from .models import Participation, Team, Video
class TeamIndex(indexes.SearchIndex, indexes.Indexable):
2020-10-15 12:55:45 +00:00
text = indexes.EdgeNgramField(document=True, model_attr="name")
trigram = indexes.EdgeNgramField(model_attr="trigram")
def get_model(self):
return Team
class ParticipationIndex(indexes.SearchIndex, indexes.Indexable):
2020-10-15 12:55:45 +00:00
text = indexes.EdgeNgramField(document=True, model_attr="team__name")
def get_model(self):
return Participation