From 031f9eecffd6986bd0e749688febf07135c7f180 Mon Sep 17 00:00:00 2001 From: Guilherme Gondim Date: Fri, 17 Oct 2008 20:11:23 +0000 Subject: [PATCH] Algumas melhorias em inlines. --- sigi/apps/casas/admin.py | 4 ++-- sigi/apps/convenios/admin.py | 4 ++-- sigi/apps/inventario/admin.py | 4 ++-- sigi/apps/parlamentares/admin.py | 8 ++++++-- sigi/apps/servicos/admin.py | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index 1a71719..ba1d8fc 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -7,11 +7,11 @@ from sigi.apps.contatos.models import Contato, Telefone class ContatosInline(generic.GenericTabularInline): model = Contato - extra = 1 + extra = 2 class TelefonesInline(generic.GenericTabularInline): model = Telefone - extra = 1 + extra = 2 class CasaLegislativaAdmin(admin.ModelAdmin): form = CasaLegislativaForm diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index 331b9b7..8d01d74 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -4,11 +4,11 @@ from sigi.apps.convenios.models import Convenio, EquipamentoPrevisto, Anexo class AnexosInline(admin.TabularInline): model = Anexo - extra = 1 + extra = 2 class EquipamentoPrevistoInline(admin.TabularInline): model = EquipamentoPrevisto - extra = 1 + extra = 2 class AnexoAdmin(admin.ModelAdmin): date_hierarchy = 'data_pub' diff --git a/sigi/apps/inventario/admin.py b/sigi/apps/inventario/admin.py index 427d397..f0dd977 100644 --- a/sigi/apps/inventario/admin.py +++ b/sigi/apps/inventario/admin.py @@ -8,11 +8,11 @@ from sigi.apps.inventario.models import (Fornecedor, Fabricante, Equipamento, class ContatosInline(generic.GenericTabularInline): model = Contato - extra = 1 + extra = 2 class TelefonesInline(generic.GenericTabularInline): model = Telefone - extra = 1 + extra = 2 class FornecedorAdmin(admin.ModelAdmin): inlines = (TelefonesInline, ContatosInline) diff --git a/sigi/apps/parlamentares/admin.py b/sigi/apps/parlamentares/admin.py index 151c3a7..24ca084 100644 --- a/sigi/apps/parlamentares/admin.py +++ b/sigi/apps/parlamentares/admin.py @@ -4,9 +4,13 @@ from django.contrib.contenttypes import generic from sigi.apps.contatos.models import Telefone from sigi.apps.parlamentares.models import Partido, Parlamentar, Mandato +class MandatosInline(admin.StackedInline): + model = Mandato + extra = 1 + class TelefonesInline(generic.GenericTabularInline): model = Telefone - extra = 1 + extra = 2 class PartidoAdmin(admin.ModelAdmin): list_display = ('nome', 'sigla') @@ -14,7 +18,7 @@ class PartidoAdmin(admin.ModelAdmin): search_fields = ('nome', 'sigla') class ParlamentarAdmin(admin.ModelAdmin): - inlines = (TelefonesInline,) + inlines = (TelefonesInline, MandatosInline) list_display = ('nome_completo', 'nome_parlamentar', 'sexo') list_display_links = ('nome_completo', 'nome_parlamentar') list_filter = ('nome_completo', 'sexo') diff --git a/sigi/apps/servicos/admin.py b/sigi/apps/servicos/admin.py index 4a0e69f..a3592ca 100644 --- a/sigi/apps/servicos/admin.py +++ b/sigi/apps/servicos/admin.py @@ -6,7 +6,7 @@ from sigi.apps.servicos.models import Servico class ContatosInline(generic.GenericTabularInline): model = Contato - extra = 1 + extra = 2 verbose_name = 'colaborador Interlegis' verbose_name_plural = 'colaboradores Interlegis'