comparison gpp/forums/search_indexes.py @ 533:387d46abcb95

Updated to Haystack 1.2.6. Got the latest Haystack, xapian backend, and queued_search from PyPi. This is for ticket #215.
author Brian Neal <bgneal@gmail.com>
date Mon, 26 Dec 2011 23:05:29 +0000
parents d9b6c4ec1977
children
comparison
equal deleted inserted replaced
532:ff67946fd4b0 533:387d46abcb95
10 class TopicIndex(CondQueuedSearchIndex): 10 class TopicIndex(CondQueuedSearchIndex):
11 text = CharField(document=True, use_template=True) 11 text = CharField(document=True, use_template=True)
12 author = CharField(model_attr='user') 12 author = CharField(model_attr='user')
13 pub_date = DateTimeField(model_attr='creation_date') 13 pub_date = DateTimeField(model_attr='creation_date')
14 14
15 def get_queryset(self): 15 def index_queryset(self):
16 return Topic.objects.filter(forum__in=Forum.objects.public_forum_ids()) 16 return Topic.objects.filter(forum__in=Forum.objects.public_forum_ids())
17 17
18 def get_updated_field(self): 18 def get_updated_field(self):
19 return 'update_date' 19 return 'update_date'
20 20
34 class PostIndex(CondQueuedSearchIndex): 34 class PostIndex(CondQueuedSearchIndex):
35 text = CharField(document=True, use_template=True) 35 text = CharField(document=True, use_template=True)
36 author = CharField(model_attr='user') 36 author = CharField(model_attr='user')
37 pub_date = DateTimeField(model_attr='creation_date') 37 pub_date = DateTimeField(model_attr='creation_date')
38 38
39 def get_queryset(self): 39 def index_queryset(self):
40 return Post.objects.filter( 40 return Post.objects.filter(
41 topic__forum__in=Forum.objects.public_forum_ids()) 41 topic__forum__in=Forum.objects.public_forum_ids())
42 42
43 def get_updated_field(self): 43 def get_updated_field(self):
44 return 'update_date' 44 return 'update_date'