fix questions search
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 21 Feb 2013 16:13:30 +0000 (17:13 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Thu, 21 Feb 2013 16:13:30 +0000 (17:13 +0100)
questions/search_indexes.py

index 1e36f41..ff49250 100755 (executable)
@@ -5,9 +5,12 @@ from .models import Question
 
 
 class QuestionIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
-    text = indexes.CharField(document=True, model_attr="__unicode__")
+    text = indexes.CharField(document=True)
     answer = indexes.CharField(model_attr="answer")
 
+    def prepare_text(self, obj):
+        return unicode(obj)
+
     def get_model(self):
         return Question