From 04e4503ca78447e0d179708d94e363c899a12049 Mon Sep 17 00:00:00 2001 From: Guilherme Gondim Date: Thu, 17 Dec 2009 20:26:30 +0000 Subject: [PATCH] =?UTF-8?q?Adicionado=20m=C3=A9todo=20para=20obter=20presi?= =?UTF-8?q?dente=20de=20CasaLegislativa.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sigi/apps/casas/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sigi/apps/casas/models.py b/sigi/apps/casas/models.py index 6f016a1..aec461e 100644 --- a/sigi/apps/casas/models.py +++ b/sigi/apps/casas/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django.db import models from django.contrib.contenttypes import generic +from sigi.apps.mesas.models import MesaDiretora class CasaLegislativa(models.Model): CASA_CHOICES = ( @@ -62,3 +63,8 @@ class CasaLegislativa(models.Model): def __unicode__(self): return self.nome + + def get_presidente(self): + mesa = MesaDiretora.objects.get(casa_legislativa=self) + membro = mesa.membromesadiretora_set.get(cargo__descricao__iexact='presidente') + return membro.parlamentar