mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-21 23:58:21 +02:00
Use Django-Haystack to make indexed researches
This commit is contained in:
13
apps/registration/search_indexes.py
Normal file
13
apps/registration/search_indexes.py
Normal file
@ -0,0 +1,13 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import Registration
|
||||
|
||||
|
||||
class RegistrationIndex(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.CharField(document=True, model_attr="user__username")
|
||||
last_name = indexes.CharField(model_attr="user__last_name")
|
||||
first_name = indexes.CharField(model_attr="user__first_name")
|
||||
email = indexes.CharField(model_attr="user__email")
|
||||
|
||||
def get_model(self):
|
||||
return Registration
|
Reference in New Issue
Block a user