Created
February 25, 2010 15:32
-
-
Save mcroydon/314633 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
from haystack.indexes import * | |
from haystack import site | |
from publications.models import Publication | |
class PublicationIndex(SearchIndex): | |
text = CharField(document=True, use_template=True) | |
author = MultiValueField() | |
def prepare_author(self, obj): | |
return [unicode(a) for a in obj.authors.all()] | |
site.register(Publication, PublicationIndex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment