|
@ -2,6 +2,7 @@ |
|
|
import csv |
|
|
import csv |
|
|
from datetime import datetime |
|
|
from datetime import datetime |
|
|
from functools import reduce |
|
|
from functools import reduce |
|
|
|
|
|
from sigi.apps.utils import to_ascii |
|
|
from geraldo.generators import PDFGenerator |
|
|
from geraldo.generators import PDFGenerator |
|
|
|
|
|
|
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
@ -257,9 +258,10 @@ class importa_casas(View): |
|
|
for reg in reader: |
|
|
for reg in reader: |
|
|
self.total_registros += 1 |
|
|
self.total_registros += 1 |
|
|
reg[self.ERROS] = [] |
|
|
reg[self.ERROS] = [] |
|
|
|
|
|
nome_orgao = to_ascii(reg[self.MUNICIPIO]) |
|
|
orgao = Orgao.objects.filter( |
|
|
orgao = Orgao.objects.filter( |
|
|
tipo__sigla=reg[self.TIPO], |
|
|
tipo__sigla=reg[self.TIPO], |
|
|
municipio__nome=reg[self.MUNICIPIO], |
|
|
municipio__search_text__icontains=nome_orgao, |
|
|
municipio__uf__sigla=reg[self.UF] |
|
|
municipio__uf__sigla=reg[self.UF] |
|
|
) |
|
|
) |
|
|
if orgao.count() == 0: |
|
|
if orgao.count() == 0: |
|
|