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:
@ -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
|
||||
|
@ -1,4 +1,3 @@
|
||||
{{ object.team.name }}
|
||||
{{ object.team.trigram }}
|
||||
{{ object.problem }}
|
||||
{{ object.get_problem_display }}
|
||||
{{ object.tournament.name }}
|
||||
|
@ -0,0 +1,3 @@
|
||||
{{ object.name }}
|
||||
{{ object.place }}
|
||||
{{ object.description }}
|
Reference in New Issue
Block a user