在一个 html 表单中,我从一个表中显示多个记录,准备更新。
现在我使用:name=<column-name>_<pk-id> value=<value>
用于字段。然后在我的python脚本中我去:
for key in form.keys():
if key.startswith('<name-A>_'):
update <table> set <name-A> = <value> where pk=<pk-id>
if key.startswith('<name-B>_'):
update <table> set <name-B> = <value> where pk=<pk-id>
是否有更“有机”的方式来处理多记录表单?