From 1ce8169b1e7b35715325f267c553b21aaecc7c3f Mon Sep 17 00:00:00 2001 From: "Camilo Carlos (Estagiario)" Date: Tue, 1 Jun 2010 21:16:27 +0000 Subject: [PATCH] Adicionando campo parlamentar em casa --- sigi/apps/casas/admin.py | 5 +++-- sigi/apps/casas/models.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sigi/apps/casas/admin.py b/sigi/apps/casas/admin.py index d10972c..7fa715f 100644 --- a/sigi/apps/casas/admin.py +++ b/sigi/apps/casas/admin.py @@ -29,7 +29,8 @@ class CasaLegislativaAdmin(admin.ModelAdmin): list_filter = ('tipo', 'municipio') fieldsets = ( (None, { - 'fields': ('nome', 'sigla', 'tipo', 'cnpj', 'observacoes'), + 'fields': ('nome', 'sigla', 'tipo', 'cnpj', 'observacoes', + 'parlamentar'), }), ('Endereço', { 'fields': ('logradouro', 'bairro', 'municipio', 'cep'), @@ -39,7 +40,7 @@ class CasaLegislativaAdmin(admin.ModelAdmin): 'fields': ('email', 'pagina_web', 'foto', 'historico'), }), ) - raw_id_fields = ('municipio',) + raw_id_fields = ('municipio','parlamentar') search_fields = ('nome', 'sigla', 'cnpj', 'logradouro', 'bairro', 'cep', 'municipio__nome', 'municipio__uf__nome', 'municipio__codigo_ibge', 'pagina_web', 'observacoes') diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index bd84bd7..35d4a13 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -2,6 +2,7 @@ from django.db import models from django.contrib.contenttypes import generic from sigi.apps.mesas.models import MesaDiretora, MembroMesaDiretora +from sigi.apps.parlamentares.models import Parlamentar class CasaLegislativa(models.Model): CASA_CHOICES = ( @@ -24,6 +25,7 @@ class CasaLegislativa(models.Model): tipo = models.CharField(max_length=2, choices=CASA_CHOICES, default='CM') cnpj = models.CharField('CNPJ', max_length=32, blank=True) observacoes = models.TextField(u'observações', blank=True) + parlamentar = models.ForeignKey(Parlamentar, null=True, blank=True) logradouro = models.CharField( max_length=100,