mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-22 19:18:22 +02:00
Index models
This commit is contained in:
@ -3,16 +3,17 @@ from haystack import indexes
|
||||
from .models import Participation, Team, Video
|
||||
|
||||
|
||||
class TeamIndex(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, model_attr="name")
|
||||
trigram = indexes.EdgeNgramField(model_attr="trigram")
|
||||
|
||||
def get_model(self):
|
||||
return Team
|
||||
class TeamIndex(indexes.ModelSearchIndex, indexes.Indexable):
|
||||
class Meta:
|
||||
model = Team
|
||||
|
||||
|
||||
class ParticipationIndex(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, model_attr="team__name")
|
||||
class ParticipationIndex(indexes.ModelSearchIndex, indexes.Indexable):
|
||||
class Meta:
|
||||
model = Participation
|
||||
|
||||
|
||||
class VideoIndex(indexes.ModelSearchIndex, indexes.Indexable):
|
||||
class Meta:
|
||||
model = Video
|
||||
|
||||
def get_model(self):
|
||||
return Participation
|
||||
|
Reference in New Issue
Block a user