~doctormo/+junk/cmsplugin_search

« back to all changes in this revision

Viewing changes to cmsplugin_search/search_indexes.py

  • Committer: Martin Owens
  • Date: 2013-07-19 19:25:06 UTC
  • Revision ID: doctormo@gmail.com-20130719192506-geq1atgv3c9ijcnc
Bump to v0.6.x and add in 2.0 support

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
try:
10
10
    from django.test.client import RequestFactory
11
11
except ImportError:
12
 
    from cms_search.utils import RequestFactory
 
12
    from cmsplugin_search.utils import RequestFactory
13
13
 
14
14
def _strip_tags(value):
15
15
    """
30
30
 
31
31
from cms.models.pluginmodel import CMSPlugin
32
32
 
33
 
from cms_search import models as proxy_models
34
 
from cms_search import settings as search_settings
 
33
from cmsplugin_search import models as proxy_models
 
34
from cmsplugin_search import settings as search_settings
35
35
 
36
36
rf = RequestFactory()
37
37
 
70
70
        def get_model(self):
71
71
            return proxy_model
72
72
 
73
 
        def index_queryset(self):
 
73
        def index_queryset(self, using=None):
74
74
            qs = proxy_model.objects.published().filter(title_set__language=language_code).distinct()
75
75
            if 'publisher' in settings.INSTALLED_APPS:
76
76
                qs = qs.filter(publisher_is_draft=True)
90
90
    prev_indices = [index for key, index in unified_index.indexes.iteritems()]
91
91
    all_indices = [ind() for ind in magic_indices] + prev_indices
92
92
    unified_index.build(indexes=all_indices)
93
 
push_indices()
 
 
b'\\ No newline at end of file'
 
93
push_indices()