예제 #1
0
파일: views.py 프로젝트: lizianem/sapl
    def get_context_data(self, **kwargs):
        context = super(NormaPesquisaView, self).get_context_data(**kwargs)

        context['title'] = _('Pesquisar Norma Jurídica')

        self.filterset.form.fields['o'].label = _('Ordenação')

        qs = self.object_list
        if 'o' in self.request.GET and not self.request.GET['o']:
            qs = qs.order_by('-ano', 'tipo', '-numero')

        qr = self.request.GET.copy()

        if 'page' in qr:
            del qr['page']

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''

        context['show_results'] = show_results_filter_set(qr)
        context['USE_SOLR'] = settings.USE_SOLR if hasattr(
            settings, 'USE_SOLR') else False

        return context
예제 #2
0
파일: views.py 프로젝트: regisvidals/sapl
 def get_context_data(self, **kwargs):
     context = super(ListarUsuarioView, self).get_context_data(**kwargs)
     paginator = context['paginator']
     page_obj = context['page_obj']
     context['page_range'] = make_pagination(page_obj.number,
                                             paginator.num_pages)
     context['NO_ENTRIES_MSG'] = 'Nenhum usuário cadastrado.'
     return context
예제 #3
0
    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
예제 #4
0
파일: views.py 프로젝트: interlegis/sapl
    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
예제 #5
0
파일: views.py 프로젝트: interlegis/sapl
    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
예제 #6
0
    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
예제 #7
0
    def get_context_data(self, **kwargs):
        context = super(ProtocoloPesquisaView, self).get_context_data(**kwargs)

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        context['title'] = _('Pesquisa de Protocolos')

        return context
예제 #8
0
파일: views.py 프로젝트: interlegis/sapl
    def get_context_data(self, **kwargs):
        context = super(ProtocoloPesquisaView,
                        self).get_context_data(**kwargs)

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(
            page_obj.number, paginator.num_pages)

        context['title'] = _('Pesquisa de Protocolos')

        return context
예제 #9
0
파일: views.py 프로젝트: fabiorauber/sapl
    def get_context_data(self, **kwargs):
        context = super(PesquisarParlamentarView,
                        self).get_context_data(**kwargs)

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        context['NO_ENTRIES_MSG'] = 'Nenhum parlamentar encontrado!'

        context['title'] = _('Parlamentares')

        return context
예제 #10
0
    def get_context_data(self, **kwargs):
        count = self.object_list.count()
        context = super(ImpressoEnderecamentoContatoView,
                        self).get_context_data(**kwargs)
        context['count'] = count

        context['title'] = _('Impressão de Etiquetas e Envelopes')
        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        qr = self.request.GET.copy()
        if 'page' in qr:
            del qr['page']
        context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''

        return context
예제 #11
0
파일: views.py 프로젝트: interlegis/sapl
    def get_context_data(self, **kwargs):
        context = super(NormaPesquisaView, self).get_context_data(**kwargs)

        context['title'] = _('Pesquisar Norma Jurídica')

        qr = self.request.GET.copy()

        if 'page' in qr:
            del qr['page']

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(
            page_obj.number, paginator.num_pages)

        context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''

        return context
예제 #12
0
    def get_context_data(self, **kwargs):
        context = super(NormaPesquisaView, self).get_context_data(**kwargs)

        context['title'] = _('Pesquisar Norma Jurídica')

        qr = self.request.GET.copy()

        if 'page' in qr:
            del qr['page']

        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''

        return context
예제 #13
0
    def get_context_data(self, **kwargs):
        count = self.object_list.count()
        context = super(RelatorioContatoAgrupadoPorProcessoView,
                        self).get_context_data(**kwargs)
        context['count'] = count

        context['title'] = _(
            'Relatório de Contatos Com Agrupamento Por Processos')
        paginator = context['paginator']
        page_obj = context['page_obj']

        context['page_range'] = make_pagination(page_obj.number,
                                                paginator.num_pages)

        qr = self.request.GET.copy()
        if 'page' in qr:
            del qr['page']
        context['filter_url'] = ('&' + qr.urlencode()) if len(qr) > 0 else ''

        return context
예제 #14
0
def test_make_pagination(index, num_pages, result):
    assert num_pages < 10 or len(result) == 10
    assert make_pagination(index, num_pages) == result