mirror of https://github.com/interlegis/sigi.git
Marcio Mazza
10 years ago
2 changed files with 5609 additions and 0 deletions
File diff suppressed because it is too large
@ -0,0 +1,16 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from dados_gerentes import atrib, gerentes |
|||
from sigi.apps.casas.models import CasaLegislativa |
|||
|
|||
|
|||
def salvar(): |
|||
for cod, abrev_gerente in atrib: |
|||
casas = CasaLegislativa.objects.filter(municipio__codigo_ibge=cod, tipo__sigla='CM') |
|||
if not casas: |
|||
print '############################# SEM CASA: ', cod |
|||
elif len(casas) > 1: |
|||
print '############################# VÁRIAS CASAS: ', cod, casas |
|||
else: |
|||
[c] = casas |
|||
c.gerente_contas = gerentes[abrev_gerente] |
|||
c.save() |
Loading…
Reference in new issue