Merge pull request #1804 from ostcar/remove_old_search
Remove old haystack files
This commit is contained in:
commit
ae315d388b
@ -1,12 +0,0 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import Item
|
||||
|
||||
|
||||
class Index(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
modelfilter_name = "Agenda" # verbose_name of model
|
||||
modelfilter_value = "agenda.item" # 'app_name.model_name'
|
||||
|
||||
def get_model(self):
|
||||
return Item
|
@ -1,12 +0,0 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import Assignment
|
||||
|
||||
|
||||
class Index(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
modelfilter_name = "Elections" # verbose_name of model
|
||||
modelfilter_value = "assignments.assignment" # 'app_name.model_name'
|
||||
|
||||
def get_model(self):
|
||||
return Assignment
|
@ -1,12 +0,0 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import Mediafile
|
||||
|
||||
|
||||
class Index(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
modelfilter_name = "Files" # verbose_name of model
|
||||
modelfilter_value = "mediafiles.mediafile" # 'app_name.model_name'
|
||||
|
||||
def get_model(self):
|
||||
return Mediafile
|
@ -1,12 +0,0 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import Motion
|
||||
|
||||
|
||||
class Index(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
modelfilter_name = "Motions" # verbose_name of model
|
||||
modelfilter_value = "motions.motion" # 'app_name.model_name'
|
||||
|
||||
def get_model(self):
|
||||
return Motion
|
@ -1,13 +0,0 @@
|
||||
from haystack import indexes
|
||||
|
||||
from .models import User
|
||||
|
||||
|
||||
class Index(indexes.SearchIndex, indexes.Indexable):
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
text = indexes.EdgeNgramField(document=True, use_template=True)
|
||||
modelfilter_name = 'Users' # verbose_name of model
|
||||
modelfilter_value = 'users.user' # 'app_name.model_name'
|
||||
|
||||
def get_model(self):
|
||||
return User
|
@ -1,23 +0,0 @@
|
||||
from django.db import models
|
||||
from haystack.signals import RealtimeSignalProcessor
|
||||
|
||||
|
||||
class OpenSlidesProcessor(RealtimeSignalProcessor):
|
||||
def setup(self):
|
||||
# Naive (listen to all model saves).
|
||||
super(OpenSlidesProcessor, self).setup()
|
||||
models.signals.m2m_changed.connect(self.handle_many_to_many)
|
||||
|
||||
def teardown(self):
|
||||
# Naive (listen to all model saves).
|
||||
super(OpenSlidesProcessor, self).teardown()
|
||||
models.signals.m2m_changed.disconnect(self.handle_many_to_many)
|
||||
|
||||
def handle_many_to_many(self, sender, instance, **kwargs):
|
||||
"""
|
||||
Given an individual model instance, determine which backends the
|
||||
update should be sent to & update the object on those backends.
|
||||
"""
|
||||
model_class = type(instance)
|
||||
if kwargs['action'] == 'post_add' or kwargs['action'] == 'post_clear' or kwargs['action'] == 'post_remove':
|
||||
self.handle_save(model_class, instance, **kwargs)
|
Loading…
Reference in New Issue
Block a user