AttributeError at /search/ 'NoneType' object has no attribute '_default_manager' Request Method: GET Request URL: http://127.0.0.1:8000/search/?q=desktop Django Version: 1.9 Exception Type: AttributeError Exception Value:'NoneType' object has no attribute '_default_manager' Exception Location: /home/ankit/venv/django/lib/python3.4/site-packages/haystack/query.py in post_process_results, line 219 Python Executable: /home/ankit/venv/django/bin/python Python Version: 3.4.3 Python Path: ['/home/ankit/venv/django/p2', '/home/ankit/venv/django/lib/python3.4', '/home/ankit/venv/django/lib/python3.4/plat-x86_64-linux-gnu', '/home/ankit/venv/django/lib/python3.4/lib-dynload', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/home/ankit/venv/django/lib/python3.4/site-packages'] Server time: Sun, 27 Dec 2015 10:29:28 +0000
My search_indexes.py
import datetime
from haystack import indexes
from inventory.models import Item
class ItemIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
pub_date = indexes.DateTimeField(model_attr='pub_date')
content_auto = indexes.EdgeNgramField(model_attr='title')
def get_model(self):
return Item
def index_queryset(self, using=None):
return self.get_model().objects.all()
My settings.py file
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
},
}