comparison gpp/news/search_indexes.py @ 219:26ee684c2033

Initial commit of Haystack search integration. See #51.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Jun 2010 20:46:52 +0000
parents
children 71fd8454688b
comparison
equal deleted inserted replaced
218:6dbb8faef085 219:26ee684c2033
1 """Haystack search index for the news application."""
2 from haystack.indexes import *
3 from haystack import site
4 from news.models import Story
5
6
7 class StoryIndex(SearchIndex):
8 text = CharField(document=True, use_template=True)
9 author = CharField(model_attr='submitter')
10 pub_date = DateTimeField(model_attr='date_submitted')
11
12 title = CharField(use_template=True, indexed=False)
13 summary = CharField(use_template=True, indexed=False)
14
15
16 site.register(Story, StoryIndex)