Mercurial > public > sg101
comparison gpp/bio/search_indexes.py @ 223:cd4124b19196
For #51; add user profiles to Haystack search.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Mon, 07 Jun 2010 03:37:36 +0000 |
parents | |
children | d424b8bae71d |
comparison
equal
deleted
inserted
replaced
222:a5fcf3d1b663 | 223:cd4124b19196 |
---|---|
1 """Haystack search index for the bio application.""" | |
2 from haystack.indexes import * | |
3 from haystack import site | |
4 | |
5 from bio.models import UserProfile | |
6 | |
7 | |
8 class UserProfileIndex(SearchIndex): | |
9 text = CharField(document=True, use_template=True) | |
10 author = CharField(model_attr='user') | |
11 | |
12 def get_queryset(self): | |
13 return UserProfile.objects.filter(user__is_active=True) | |
14 | |
15 | |
16 site.register(UserProfile, UserProfileIndex) |