

def get_search_context_data(self, context_object_name=None):
    "\n        Return metadata about the search in a dictionary useful to populate\n        template contexts. If you pass in a context_object_name, the dictionary\n        will also contain the actual list of found objects.\n\n        The expected usage is to call this function in your view's\n        get_context_data:\n\n            search_context = self.search_handler.get_search_context_data(\n                self.context_object_name)\n            context.update(search_context)\n            return context\n\n        "
    munger = self.get_facet_munger()
    facet_data = munger.facet_data()
    has_facets = any([data['results'] for data in facet_data.values()])
    context = {
        'facet_data': facet_data,
        'has_facets': has_facets,
        'selected_facets': self.request_data.getlist('selected_facets'),
        'form': self.search_form,
        'paginator': self.paginator,
        'page_obj': self.page,
    }
    if (context_object_name is not None):
        context[context_object_name] = self.get_paginated_objects()
    return context

dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/search/search_handlers.py SearchHandler.get_search_context_data/original