19 lines
494 B
Python
19 lines
494 B
Python
|
from haystack import indexes
|
||
|
|
||
|
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")
|
||
|
|
||
|
def get_model(self):
|
||
|
return Team
|
||
|
|
||
|
|
||
|
class ParticipationIndex(indexes.SearchIndex, indexes.Indexable):
|
||
|
text = indexes.CharField(document=True, model_attr="team__trigram")
|
||
|
|
||
|
def get_model(self):
|
||
|
return Participation
|