Remove haystack indexes modules.
parent
63e53fec5d
commit
851d5df3a8
|
@ -1,23 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
from rest_framework import serializers
|
|
||||||
|
|
||||||
|
|
||||||
class SearchSerializer(serializers.Serializer):
|
|
||||||
id = serializers.CharField(max_length=255)
|
|
||||||
model_name = serializers.CharField(max_length=255)
|
|
||||||
pk = serializers.IntegerField()
|
|
||||||
score = serializers.FloatField()
|
|
||||||
stored_fields = serializers.SerializerMethodField('get_stored_fields')
|
|
||||||
|
|
||||||
def get_stored_fields(self, obj):
|
|
||||||
return obj.get_stored_fields()
|
|
||||||
|
|
||||||
def restore_object(self, attrs, instance=None):
|
|
||||||
"""
|
|
||||||
Given a dictionary of deserialized field values, either update
|
|
||||||
an existing model instance, or create a new model instance.
|
|
||||||
"""
|
|
||||||
if instance is not None:
|
|
||||||
return instance
|
|
||||||
return attrs
|
|
|
@ -1,16 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class DocumentIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True,
|
|
||||||
template_name='search/indexes/document_text.txt')
|
|
||||||
title = indexes.CharField(model_attr='title')
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.Document
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -1,18 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class IssueIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True,
|
|
||||||
template_name='search/indexes/issue_text.txt')
|
|
||||||
title = indexes.CharField(model_attr='subject')
|
|
||||||
project_id = indexes.IntegerField(model_attr="project_id")
|
|
||||||
description = indexes.CharField(model_attr="description")
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.Issue
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -1,17 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class QuestionIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True,
|
|
||||||
template_name='search/indexes/question_text.txt')
|
|
||||||
title = indexes.CharField(model_attr='subject')
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.Question
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -1,18 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class TaskIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True,
|
|
||||||
template_name='search/indexes/task_text.txt')
|
|
||||||
title = indexes.CharField(model_attr='subject')
|
|
||||||
project_id = indexes.IntegerField(model_attr="project_id")
|
|
||||||
description = indexes.CharField(model_attr="description")
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.Task
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -6,11 +6,11 @@ from django.dispatch import receiver
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from picklefield.fields import PickledObjectField
|
from picklefield.fields import PickledObjectField
|
||||||
|
import reversion
|
||||||
|
|
||||||
from greenmine.base.utils.slug import ref_uniquely
|
from greenmine.base.utils.slug import ref_uniquely
|
||||||
from greenmine.base.notifications.models import WatchedMixin
|
from greenmine.base.notifications.models import WatchedMixin
|
||||||
|
|
||||||
import reversion
|
|
||||||
|
|
||||||
|
|
||||||
class RolePoints(models.Model):
|
class RolePoints(models.Model):
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class UserStoryIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True,
|
|
||||||
template_name='search/indexes/userstory_text.txt')
|
|
||||||
title = indexes.CharField(model_attr='subject')
|
|
||||||
project_id = indexes.IntegerField(model_attr="project_id")
|
|
||||||
description = indexes.CharField(model_attr="description")
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.UserStory
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -1,14 +0,0 @@
|
||||||
# -* coding: utf-8 -*-
|
|
||||||
|
|
||||||
from haystack import indexes
|
|
||||||
from . import models
|
|
||||||
|
|
||||||
|
|
||||||
class WikiPageIndex(indexes.SearchIndex, indexes.Indexable):
|
|
||||||
text = indexes.CharField(document=True, use_template=True, template_name='search/indexes/wikipage_text.txt')
|
|
||||||
|
|
||||||
def get_model(self):
|
|
||||||
return models.WikiPage
|
|
||||||
|
|
||||||
def index_queryset(self, using=None):
|
|
||||||
return self.get_model().objects.all()
|
|
|
@ -276,19 +276,8 @@ ANONYMOUS_USER_ID = -1
|
||||||
|
|
||||||
GRAPPELLI_INDEX_DASHBOARD = 'greenmine.dashboard.CustomIndexDashboard'
|
GRAPPELLI_INDEX_DASHBOARD = 'greenmine.dashboard.CustomIndexDashboard'
|
||||||
|
|
||||||
HAYSTACK_CONNECTIONS = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
|
|
||||||
'PATH': os.path.join(os.path.dirname(__file__), '../search/index'),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
HAYSTACK_DEFAULT_OPERATOR = 'AND'
|
|
||||||
|
|
||||||
MAX_SEARCH_RESULTS = 100
|
MAX_SEARCH_RESULTS = 100
|
||||||
|
|
||||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
|
||||||
|
|
||||||
REST_FRAMEWORK = {
|
REST_FRAMEWORK = {
|
||||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||||
'greenmine.base.users.auth.SessionAuthentication',
|
'greenmine.base.users.auth.SessionAuthentication',
|
||||||
|
|
Loading…
Reference in New Issue