From ed28b9787a18219efd0df57f9d17d7474a2f2be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 16 May 2013 13:05:14 -0300 Subject: [PATCH] =?UTF-8?q?Adicionado=20campo=20UF=20na=20changelist=20dos?= =?UTF-8?q?=20conv=C3=AAnios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/convenios/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 6553911..011ccf2 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -49,7 +49,7 @@ class ConvenioAdmin(admin.ModelAdmin): ) actions = ['adicionar_convenios'] inlines = (TramitacaoInline, AnexosInline, EquipamentoPrevistoInline) - list_display = ('num_convenio', 'casa_legislativa', + list_display = ('num_convenio', 'casa_legislativa', 'get_uf', 'data_adesao','data_retorno_assinatura','data_pub_diario','data_termo_aceite', 'projeto', ) @@ -61,6 +61,11 @@ class ConvenioAdmin(admin.ModelAdmin): queryset = queryset_ascii search_fields = ('id', 'search_text',#'casa_legislativa__nome', 'num_processo_sf','num_convenio') + + def get_uf(self, obj): + return obj.casa_legislativa.municipio.uf.sigla + get_uf.short_description = 'UF' + get_uf.admin_order_field = 'casa_legislativa__municipio__uf__sigla' def changelist_view(self, request, extra_context=None): return super(ConvenioAdmin, self).changelist_view(