bgneal@221: """Haystack search index for the downloads application.""" bgneal@221: from haystack.indexes import * bgneal@221: from haystack import site bgneal@392: from queued_search.indexes import QueuedSearchIndex bgneal@221: bgneal@221: from downloads.models import Download bgneal@221: bgneal@221: bgneal@392: class DownloadIndex(QueuedSearchIndex): bgneal@221: text = CharField(document=True, use_template=True) bgneal@221: author = CharField(model_attr='user') bgneal@221: pub_date = DateTimeField(model_attr='date_added') bgneal@221: bgneal@221: def get_queryset(self): bgneal@221: return Download.public_objects.all() bgneal@221: bgneal@277: def get_updated_field(self): bgneal@277: return 'update_date' bgneal@277: bgneal@221: bgneal@221: site.register(Download, DownloadIndex)