From 3a306f8da4c4885f83b88566c3efca6ab05f3023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 7 Dec 2016 16:00:31 -0200 Subject: [PATCH] ordena pesquisa doc administrativo -data --- sapl/protocoloadm/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 87a1a3710..33bade736 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -403,6 +403,9 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin, qs = self.get_queryset() 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,