add search indexes for all apps
This commit is contained in:
parent
4eefbd54bc
commit
80dbca6d82
12
itf/events/search_indexes.py
Executable file
12
itf/events/search_indexes.py
Executable file
|
@ -0,0 +1,12 @@
|
|||
from haystack.indexes import *
|
||||
from haystack import site
|
||||
from models import *
|
||||
|
||||
|
||||
class EventIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
title = CharField(model_attr='title')
|
||||
|
||||
|
||||
site.register(Event, EventIndex)
|
||||
|
|
@ -20,14 +20,14 @@ class ProjectIndex(SearchIndex):
|
|||
intro = CharField(model_attr='intro')
|
||||
|
||||
|
||||
class ParticipantIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
name = CharField(model_attr='name')
|
||||
title = CharField(model_attr='title')
|
||||
short_bio = CharField(model_attr='short_bio')
|
||||
# class ParticipantIndex(SearchIndex):
|
||||
# text = CharField(document=True, use_template=True)
|
||||
# name = CharField(model_attr='name')
|
||||
# title = CharField(model_attr='title')
|
||||
# short_bio = CharField(model_attr='short_bio')
|
||||
|
||||
|
||||
site.register(Meeting, MeetingIndex)
|
||||
site.register(Project, ProjectIndex)
|
||||
site.register(Participant, ParticipantIndex)
|
||||
#site.register(Participant, ParticipantIndex)
|
||||
|
||||
|
|
37
itf/itfprofiles/search_indexes.py
Executable file
37
itf/itfprofiles/search_indexes.py
Executable file
|
@ -0,0 +1,37 @@
|
|||
from haystack.indexes import *
|
||||
from haystack import site
|
||||
from models import *
|
||||
|
||||
|
||||
class PersonIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
title = CharField(model_attr='first_name')
|
||||
|
||||
'''
|
||||
def index_queryset(self):
|
||||
"""Used when the entire index for model is updated."""
|
||||
return Note.objects.filter(pub_date__lte=datetime.datetime.now())
|
||||
'''
|
||||
|
||||
class TheatreGroupIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
title = CharField(model_attr='name')
|
||||
|
||||
|
||||
class ProductionIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
title = CharField(model_attr='name')
|
||||
|
||||
|
||||
# class ParticipantIndex(SearchIndex):
|
||||
# text = CharField(document=True, use_template=True)
|
||||
# name = CharField(model_attr='name')
|
||||
# title = CharField(model_attr='title')
|
||||
# short_bio = CharField(model_attr='short_bio')
|
||||
|
||||
|
||||
site.register(Person, PersonIndex)
|
||||
site.register(TheatreGroup, TheatreGroupIndex)
|
||||
site.register(Production, ProductionIndex)
|
||||
#site.register(Participant, ParticipantIndex)
|
||||
|
14
itf/scriptbank/search_indexes.py
Executable file
14
itf/scriptbank/search_indexes.py
Executable file
|
@ -0,0 +1,14 @@
|
|||
from haystack.indexes import *
|
||||
from haystack import site
|
||||
from models import Script
|
||||
|
||||
|
||||
class ScriptIndex(SearchIndex):
|
||||
text = CharField(document=True, use_template=True)
|
||||
title = CharField(model_attr='title')
|
||||
|
||||
|
||||
site.register(Script, ScriptIndex)
|
||||
|
||||
#site.register(Participant, ParticipantIndex)
|
||||
|
4
itf/templates/search/indexes/events/event_text.txt
Normal file
4
itf/templates/search/indexes/events/event_text.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ title }}
|
||||
{{ oneliner }}
|
||||
{{ description }}
|
||||
{{ address }}
|
3
itf/templates/search/indexes/itfprofiles/person_text.txt
Normal file
3
itf/templates/search/indexes/itfprofiles/person_text.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ first_name }} {{ last_name }}
|
||||
|
||||
{{ about }}
|
|
@ -0,0 +1,3 @@
|
|||
{{ name }}
|
||||
{{ synopsis }}
|
||||
{{ anecdotes }}
|
|
@ -0,0 +1,2 @@
|
|||
{{ name }}
|
||||
{{ about }}
|
3
itf/templates/search/indexes/scriptbank/script_text.txt
Normal file
3
itf/templates/search/indexes/scriptbank/script_text.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ title }}
|
||||
{{ synopsis }}
|
||||
{{ author }}
|
Loading…
Reference in New Issue
Block a user