

@property
def page_context(self):
    more_pages = (False if (len(self.d_results) <= (self.page * self.projects_per_page)) else True)
    facet_map = fill_mapping_with_facets(DEPLOYMENT_MAPPING, self.results, self.params)
    include_unapproved = (True if (self.request.GET.get('is_approved', '') == 'false') else False)
    deployments = self.d_results[((self.page - 1) * self.projects_per_page):(self.page * self.projects_per_page)]
    return {
        'deployments': deployments,
        'page': self.page,
        'prev_page': (self.page - 1),
        'next_page': (self.page + 1),
        'more_pages': more_pages,
        'include_unapproved': include_unapproved,
        'facet_map': facet_map,
        'query_str': self.request.META['QUERY_STRING'],
        'search_url': reverse(self.urlname),
        'search_query': self.params.get('search', [''])[0],
    }

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/appstore/views.py DeploymentsView.page_context/original