bgneal@223: """Haystack search index for the bio application.""" bgneal@223: from haystack.indexes import * bgneal@223: from haystack import site bgneal@223: bgneal@223: from bio.models import UserProfile bgneal@223: bgneal@223: bgneal@223: class UserProfileIndex(SearchIndex): bgneal@223: text = CharField(document=True, use_template=True) bgneal@223: author = CharField(model_attr='user') bgneal@223: bgneal@223: def get_queryset(self): bgneal@223: return UserProfile.objects.filter(user__is_active=True) bgneal@223: bgneal@223: bgneal@223: site.register(UserProfile, UserProfileIndex)