ここでやっていることを正確に行うために、もっと「美しい」ものを探しています。現在順調に稼働中です。
f = open(pathdata+'blocoh2.csv', 'r')
reader = csv.reader(f)
for row in reader:
dpt, created = Departamento.objects.get_or_create(name = row[3])
print str(created) + "dprmentp"
blc, created = Bloco.objects.get_or_create(nm_andar = row[5],name = row[6])
print str(created) + "bloco"
tplugar, created = TipoLugar.objects.get_or_create(name = (smart_str(row[2])))
print str(created) + "tipo_lugar"
lugar, created = Lugar.objects.get_or_create(name=row[0], utilizacao=row[1],
tipoLugar = tplugar,
metragem = 0,
coordx = 0,
coordy = 0,
bloco = blc,
departamento = dpt)
print str(created) + "lugar"
前もって感謝します