Skip to content
Snippets Groups Projects
Commit 3718b965 authored by Johannes Raggam's avatar Johannes Raggam
Browse files

plone integration

parent de060aca
No related branches found
No related tags found
No related merge requests found
...@@ -6,18 +6,10 @@ from datetime import datetime ...@@ -6,18 +6,10 @@ from datetime import datetime
from program.models import Note, Show from program.models import Note, Show
class NoteIndex(SearchIndex): class NoteIndex(SearchIndex):
text = CharField(document=True, use_template=True) SearchableText = CharField(document=True, use_template=True)
last_updated = DateTimeField(model_attr='last_updated')
def get_queryset(self):
return Note.objects.filter(last_updated__lte=datetime.now())
class ShowIndex(SearchIndex): class ShowIndex(SearchIndex):
text = CharField(document=True, use_template=True) SearchableText = CharField(document=True, use_template=True)
last_updated = DateTimeField(model_attr='last_updated')
def get_queryset(self):
return Show.objects.filter(last_updated__lte=datetime.now())
site.register(Note, NoteIndex) site.register(Note, NoteIndex)
site.register(Show, ShowIndex) site.register(Show, ShowIndex)
\ No newline at end of file
...@@ -71,4 +71,6 @@ INSTALLED_APPS = ( ...@@ -71,4 +71,6 @@ INSTALLED_APPS = (
HAYSTACK_SITECONF = 'helsinki.program.search_sites' HAYSTACK_SITECONF = 'helsinki.program.search_sites'
HAYSTACK_SEARCH_ENGINE = 'solr' HAYSTACK_SEARCH_ENGINE = 'solr'
HAYSTACK_SOLR_URL = 'http://localhost:8983/solr' HAYSTACK_SOLR_URL = 'http://localhost:8988/solr'
# plone integration
HAYSTACK_ID_FIELD = 'docid'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment