From d337ce4cac2a315d8d63518e3879267fbea1e763 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 12 Sep 2016 16:50:55 -0300 Subject: [PATCH] Fix #577 --- sapl/parlamentares/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 8b8237007..fda746e0e 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -332,6 +332,7 @@ class ParlamentarCrud(Crud): class ListView(CrudListView): template_name = "parlamentares/parlamentares_list.html" paginate_by = None + ordering = '-nome_parlamentar' def take_legislatura_id(self): legislaturas = Legislatura.objects.all().order_by( @@ -351,7 +352,8 @@ class ParlamentarCrud(Crud): def get_queryset(self): if self.take_legislatura_id() != 0: mandatos = Mandato.objects.filter( - legislatura_id=self.take_legislatura_id()) + legislatura_id=self.take_legislatura_id()).order_by( + 'parlamentar__nome_parlamentar') return mandatos return []