From 92964db767dbc67e16b9a566b12cfd3495b5022b Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 2 May 2016 11:46:21 -0300 Subject: [PATCH] =?UTF-8?q?Ordena=20tramita=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- materia/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/materia/views.py b/materia/views.py index d93d8d4ff..d4cbe2042 100644 --- a/materia/views.py +++ b/materia/views.py @@ -71,6 +71,13 @@ class TramitacaoCrud(MasterDetailCrud): class UpdateView(MasterDetailCrud.UpdateView): form_class = TramitacaoForm + class ListView(MasterDetailCrud.ListView): + + def get_queryset(self): + qs = super(MasterDetailCrud.ListView, self).get_queryset() + kwargs = {self.crud.parent_field: self.kwargs['pk']} + return qs.filter(**kwargs).order_by('-data_tramitacao') + class AutoriaCrud(MasterDetailCrud): model = Autoria