def get_context_data(self, **kwargs): context = super(ProtocoloListView, self).get_context_data(**kwargs) paginator = context['paginator'] page_obj = context['page_obj'] context['page_range'] = make_pagination(page_obj.number, paginator.num_pages) return context
def get_context_data(self, **kwargs): context = super(ProtocoloListView, self).get_context_data( **kwargs) paginator = context['paginator'] page_obj = context['page_obj'] context['page_range'] = make_pagination( page_obj.number, paginator.num_pages) return context
def get_context_data(self, **kwargs): context = super(PesquisarDocumentoAdministrativoView, self).get_context_data(**kwargs) paginator = context['paginator'] page_obj = context['page_obj'] context['page_range'] = make_pagination(page_obj.number, paginator.num_pages) return context
def get_context_data(self, **kwargs): context = super(PesquisarDocumentoAdministrativoView, self).get_context_data(**kwargs) paginator = context['paginator'] page_obj = context['page_obj'] context['page_range'] = make_pagination( page_obj.number, paginator.num_pages) return context
def test_make_pagination(index, num_pages, result): assert num_pages < 10 or len(result) == 10 assert make_pagination(index, num_pages) == result