From 940c193fe3f04e7d1477e4e499f46188028195a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 7 Dec 2016 16:08:43 -0200 Subject: [PATCH] resultado pesquisa protocolo data decrescente --- sapl/protocoloadm/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 33bade736..3c9f592dd 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -92,6 +92,9 @@ class ProtocoloPesquisaView(PermissionRequiredMixin, FilterView): qs = self.get_queryset().order_by('ano', 'numero') qs = qs.distinct() + + if 'o' in self.request.GET and not self.request.GET['o']: + qs = qs.order_by('-ano', '-numero') kwargs.update({ 'queryset': qs,