1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-04 01:32:11 +02:00

Index tournaments

This commit is contained in:
Yohann D'ANELLO
2021-01-18 23:49:27 +01:00
parent 96adb01edb
commit cb5f597547
8 changed files with 37 additions and 9 deletions

View File

@ -3,7 +3,7 @@
from haystack import indexes
from .models import Participation, Team
from .models import Participation, Team, Tournament
class TeamIndex(indexes.ModelSearchIndex, indexes.Indexable):
@ -24,3 +24,13 @@ class ParticipationIndex(indexes.ModelSearchIndex, indexes.Indexable):
class Meta:
model = Participation
class TournamentIndex(indexes.ModelSearchIndex, indexes.Indexable):
"""
Index all tournaments by their name.
"""
text = indexes.NgramField(document=True, use_template=True)
class Meta:
model = Tournament