From 25be37eb0dc69b9962d49ebc2b42c0847956f824 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 12 Apr 2017 19:40:22 -0300 Subject: [PATCH] =?UTF-8?q?Ajusta=20a=20ordem=20das=20partes=20do=20expedi?= =?UTF-8?q?ente=20no=20relat=C3=B3rio=20para=20ficar=20em=20conformidade?= =?UTF-8?q?=20com=20o=20resumo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index a5b129118..0ae5bb39f 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -518,14 +518,14 @@ def get_sessao_plenaria(sessao, casa): # Exibe os Expedientes lst_expedientes = [] - for tip_expediente in TipoExpediente.objects.all(): - for expediente in ExpedienteSessao.objects.filter( - sessao_plenaria=sessao, tipo=tip_expediente): - dic_expedientes = {} - dic_expedientes["nom_expediente"] = str(tip_expediente) - dic_expedientes["txt_expediente"] = (expediente.conteudo) - if dic_expedientes: - lst_expedientes.append(dic_expedientes) + expedientes = ExpedienteSessao.objects.filter( + sessao_plenaria=sessao).order_by('tipo__nome') + for e in expedientes: + dic_expedientes = {} + dic_expedientes["nom_expediente"] = str(e.tipo) + dic_expedientes["txt_expediente"] = (e.conteudo) + if dic_expedientes: + lst_expedientes.append(dic_expedientes) # Lista das matérias do Expediente, incluindo o resultado das votacoes lst_expediente_materia = []