1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-02-06 14:53:02 +00:00

34 lines
813 B
Python
Raw Normal View History

from haystack import indexes
from .models import Participation, Team, Video
2020-10-15 16:29:50 +02:00
class TeamIndex(indexes.ModelSearchIndex, indexes.Indexable):
2020-10-30 19:46:46 +01:00
"""
Index all teams by their name and trigram.
"""
2020-10-15 17:26:22 +02:00
text = indexes.NgramField(document=True, use_template=True)
2020-10-15 16:29:50 +02:00
class Meta:
model = Team
2020-10-15 16:29:50 +02:00
class ParticipationIndex(indexes.ModelSearchIndex, indexes.Indexable):
2020-10-30 19:46:46 +01:00
"""
Index all participations by their team name and team trigram.
"""
2020-10-15 17:26:22 +02:00
text = indexes.NgramField(document=True, use_template=True)
2020-10-15 16:29:50 +02:00
class Meta:
model = Participation
2020-10-15 16:29:50 +02:00
class VideoIndex(indexes.ModelSearchIndex, indexes.Indexable):
2020-10-30 19:46:46 +01:00
"""
Index all teams by their team name and team trigram.
"""
2020-10-15 17:26:22 +02:00
text = indexes.NgramField(document=True, use_template=True)
2020-10-15 16:29:50 +02:00
class Meta:
model = Video