From 6e2c89b469589130f294c8ef296b6f321daa3d9f Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 10 May 2016 17:42:59 -0300 Subject: [PATCH] Fix #429 - ordem descrescente de mandato parlamentar (#437) --- 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