]> git.0d.be Git - panikweb.git/blobdiff - panikweb/search.py
use page pictures in topiks menu items
[panikweb.git] / panikweb / search.py
index 5112e2be4952c56c1b1cb17a5792def0e541ce62..10091bc62f66ef246a71f57405cec3f7b255df82 100644 (file)
@@ -76,7 +76,7 @@ class CustomSolrSearchBackend(haystack.backends.solr_backend.SolrSearchBackend):
             limit_to_registered_models = getattr(settings, 'HAYSTACK_LIMIT_TO_REGISTERED_MODELS', True)
 
         if models and len(models):
-            model_choices = sorted(['%s.%s' % (model._meta.app_label, model._meta.module_name) for model in models])
+            model_choices = sorted(['%s.%s' % (model._meta.app_label, model._meta.model_name) for model in models])
         elif limit_to_registered_models:
             # Using narrow queries, limit the results to only models handled
             # with the current routers.
@@ -135,7 +135,8 @@ class GlobalSearchForm(FacetedSearchForm):
 class SearchView(FacetedSearchView):
     def extra_context(self):
         context = super(SearchView, self).extra_context()
-        context['sectionName'] = 'Search'
+        if self.request.GET.getlist('selected_facets'):
+            context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
         context['selected_categories'] = [
                 x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
                 if x.startswith('categories_exact')]
@@ -180,7 +181,8 @@ class ListenArchivesView(FacetedSearchView):
 
     def extra_context(self):
         context = super(ListenArchivesView, self).extra_context()
-        context['sectionName'] = "Listen"
+        if self.request.GET.getlist('selected_facets'):
+            context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
         context['selected_format'] = [
                 x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
                 if x.startswith('format_exact')]
@@ -220,7 +222,8 @@ class NewsArchivesView(FacetedSearchView):
 
     def extra_context(self):
         context = super(NewsArchivesView, self).extra_context()
-        context['sectionName'] = 'News'
+        if self.request.GET.getlist('selected_facets'):
+            context['facets_qs'] = '&selected_facets=' + '&'.join(self.request.GET.getlist('selected_facets'))
         context['selected_news_categories'] = [
                 x.split(':', 1)[1] for x in self.request.GET.getlist('selected_facets')
                 if x.startswith('news_categories_exact')]