it/itf/festival/search_indexes.py
2011-10-10 16:01:09 +05:30

27 lines
657 B
Python
Executable File

from haystack.indexes import *
from haystack import site
from models import *
class MeetingIndex(SearchIndex):
text = CharField(document=True, use_template=True)
'''
def index_queryset(self):
"""Used when the entire index for model is updated."""
return Note.objects.filter(pub_date__lte=datetime.datetime.now())
'''
class ProjectIndex(SearchIndex):
text = CharField(document=True, use_template=True)
class ParticipantIndex(SearchIndex):
text = CharField(document=True, use_template=True)
site.register(Meeting, MeetingIndex)
site.register(Project, ProjectIndex)
site.register(Participant, ParticipantIndex)