##// END OF EJS Templates
Don't use <p> tags in parsing because the tag cannot be closed inside a tag to...
Don't use <p> tags in parsing because the tag cannot be closed inside a tag to create a new paragraph

File last commit:

r692:d0013853 1.8-dev
r750:fa59c3d1 default
Show More
search_indexes.py
24 lines | 616 B | text/x-python | PythonLexer
neko259
Implemented search over posts. Moved get_user and get_theme to utils module. Use context processors instead of creating context in the base view. Removed unused imports in some modules
r690 from haystack import indexes
neko259
Added tag search. Refactored search to show any model results in a list.
r692 from boards.models import Post, Tag
neko259
Implemented search over posts. Moved get_user and get_theme to utils module. Use context processors instead of creating context in the base view. Removed unused imports in some modules
r690
__author__ = 'neko259'
class PostIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
return Post
def index_queryset(self, using=None):
neko259
Added tag search. Refactored search to show any model results in a list.
r692 return self.get_model().objects.all()
class TagIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
def get_model(self):
return Tag
def index_queryset(self, using=None):
return self.get_model().objects.get_not_empty_tags()