mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-09 06:10:18 +02:00
All indexed fields are autocompleted
This commit is contained in:
@ -4,15 +4,15 @@ from .models import Participation, Team, Video
|
||||
|
||||
|
||||
class TeamIndex(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.CharField(document=True, model_attr="name")
|
||||
trigram = indexes.CharField(model_attr="trigram")
|
||||
text = indexes.EdgeNgramField(document=True, model_attr="name")
|
||||
trigram = indexes.EdgeNgramField(model_attr="trigram")
|
||||
|
||||
def get_model(self):
|
||||
return Team
|
||||
|
||||
|
||||
class ParticipationIndex(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.CharField(document=True, model_attr="team__trigram")
|
||||
text = indexes.EdgeNgramField(document=True, model_attr="team__name")
|
||||
|
||||
def get_model(self):
|
||||
return Participation
|
||||
|
Reference in New Issue
Block a user