我在找更“漂亮”的东西来做我在这里做的事情。 现在工作得很好。你知道吗
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"
提前谢谢
您可以阅读PEP8并将代码格式化为这个Python标准。你知道吗
相关问题 更多 >
编程相关推荐