search stuff
This commit is contained in:
parent
ca35d9c890
commit
cc38eb0573
26
itf/festival/search_indexes.py
Executable file
26
itf/festival/search_indexes.py
Executable file
|
@ -0,0 +1,26 @@
|
||||||
|
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)
|
||||||
|
|
3
itf/templates/search/indexes/festival/meeting_text.txt
Normal file
3
itf/templates/search/indexes/festival/meeting_text.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{{ object.title }}
|
||||||
|
{{ object.intro }}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{{ object.name }}
|
||||||
|
{{ object.title }}
|
||||||
|
{{ object.short_bio }}
|
2
itf/templates/search/indexes/festival/project_text.txt
Normal file
2
itf/templates/search/indexes/festival/project_text.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{{ object.title }}
|
||||||
|
{{ object.intro }}
|
Loading…
Reference in New Issue
Block a user