1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 13:18:25 +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

View File

@ -1,4 +1,3 @@
{{ object.team.name }}
{{ object.team.trigram }}
{{ object.problem }}
{{ object.get_problem_display }}
{{ object.tournament.name }}

View File

@ -0,0 +1,3 @@
{{ object.name }}
{{ object.place }}
{{ object.description }}