Created
April 11, 2010 14:03
-
-
Save mdornseif/362734 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
search_sites.py - basic configuration for the haystack engine | |
""" | |
import haystack | |
import haystack.indexes | |
import django.contrib.flatpages.models | |
haystack.autodiscover() | |
class FlatpageIndex(haystack.indexes.SearchIndex): | |
text = haystack.indexes.CharField(document=True, model_attr='content') | |
#def get_queryset(self): | |
# """Used when the entire index for model is updated.""" | |
# return Note.objects.filter(pub_date__lte=datetime.datetime.now()) | |
# TODO: support | |
# registration_required | |
# sites | |
haystack.site.register(django.contrib.flatpages.models.FlatPage, FlatpageIndex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment