From 2f42e64ae75d1b1187c995aa71f3d34e46eee767 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 10 May 2016 17:29:17 -0300 Subject: [PATCH] Fix #429 - ordem descrescente de mandato parlamentar --- parlamentares/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parlamentares/views.py b/parlamentares/views.py index 50859c56c..57e42c4a4 100644 --- a/parlamentares/views.py +++ b/parlamentares/views.py @@ -27,8 +27,14 @@ TipoAfastamentoCrud = Crud.build(TipoAfastamento, 'tipo_afastamento') TipoMilitarCrud = Crud.build(SituacaoMilitar, 'tipo_situa_militar') DependenteCrud = MasterDetailCrud.build(Dependente, 'parlamentar', '') -MandatoCrud = MasterDetailCrud.build(Mandato, 'parlamentar', '') +class MandatoCrud(MasterDetailCrud): + model = Mandato + parent_field = 'parlamentar' + help_path = '' + + class ListView(MasterDetailCrud.ListView): + ordering = ('-data_fim_mandato') class FiliacaoCrud(MasterDetailCrud): model = Filiacao