fnp
/
prawokultury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update django-migdal
[prawokultury.git]
/
questions
/
search_indexes.py
diff --git
a/questions/search_indexes.py
b/questions/search_indexes.py
index
1e36f41
..
e2e05f8
100755
(executable)
--- a/
questions/search_indexes.py
+++ b/
questions/search_indexes.py
@@
-4,13
+4,16
@@
from haystack import indexes
from .models import Question
from .models import Question
-class QuestionIndex(indexes.
RealTime
SearchIndex, indexes.Indexable):
- text = indexes.CharField(document=True
, model_attr="__unicode__"
)
+class QuestionIndex(indexes.SearchIndex, indexes.Indexable):
+ text = indexes.CharField(document=True)
answer = indexes.CharField(model_attr="answer")
answer = indexes.CharField(model_attr="answer")
+ def prepare_text(self, obj):
+ return unicode(obj)
+
def get_model(self):
return Question
def get_model(self):
return Question
- def index_queryset(self):
+ def index_queryset(self
, using=None
):
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(published=True)
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(published=True)