【发布时间】:2012-09-26 10:54:35
【问题描述】:
GAE 快把我逼疯了。
我有以下几点:
if id_puertas[x]:
puerta = Puerta.get_by_id(int(id_puertas[x]))
puerta.ubicacion = ubicacion_puertas[x],
puerta.ancho = float(ancho_puertas[x]),
puerta.marco = float(marco_puertas[x]),
puerta.alto = float(alto_puertas[x]),
puerta.giro = giro_puertas[x],
puerta.condena = True if condena_puertas[x] == 'Si' else False,
puerta.extra = extra_puertas[x]
else:
puerta = Puerta(
medicion = medicion.key().id(),
ubicacion = ubicacion_puertas[x],
ancho = float(ancho_puertas[x]),
marco = float(marco_puertas[x]),
alto = float(alto_puertas[x]),
giro = giro_puertas[x],
condena = True if condena_puertas[x] == 'Si' else False,
extra = extra_puertas[x]
)
puerta.put()
相同的表单发送id_puerta 作为数字或空白。如果是数字,则更新数据存储区中的实体。如果为空,则创建一个新实体。
创作完美。
但是,如果我重新发送相同的表单(即使没有修改),更新会在第一次分配时阻塞。
ubicacion_puertas[x] 是一个字符串(创建时与更新时相同),puerta.ubicacion 是 StringProperty,,但我收到以下错误:
BadValueError: Property ubicacion must be a str or unicode instance, not a tuple
在调试器中,我清楚地看到 ubicacion_puertas[0] 是 u'Salon'。所以我无法理解这个错误。
【问题讨论】:
标签: python google-app-engine google-cloud-datastore webapp2