Mercurial > public > sg101
annotate gpp/ygroup/search_indexes.py @ 445:e9f203c5f5bb
Attempting to fix #218; update the topic last visit time with 'now' when viewing the last page of a topic, otherwise use the creation time of the last post on the page.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 08 Jun 2011 00:24:41 +0000 |
parents | 79240675b903 |
children | b910cc1460c8 |
rev | line source |
---|---|
bgneal@323 | 1 """ |
bgneal@323 | 2 Haystack search index for the Yahoo Group archives application. |
bgneal@323 | 3 |
bgneal@323 | 4 """ |
bgneal@323 | 5 from haystack.indexes import * |
bgneal@323 | 6 from haystack import site |
bgneal@392 | 7 from queued_search.indexes import QueuedSearchIndex |
bgneal@323 | 8 |
bgneal@323 | 9 from ygroup.models import Post |
bgneal@323 | 10 |
bgneal@323 | 11 |
bgneal@392 | 12 class PostIndex(QueuedSearchIndex): |
bgneal@323 | 13 text = CharField(document=True, use_template=True) |
bgneal@323 | 14 pub_date = DateTimeField(model_attr='creation_date') |
bgneal@323 | 15 |
bgneal@323 | 16 def get_updated_field(self): |
bgneal@323 | 17 return 'creation_date' |
bgneal@323 | 18 |
bgneal@323 | 19 |
bgneal@323 | 20 site.register(Post, PostIndex) |