if request.files is not None and error is None:
attachments = request.files['attachments[]']
if len(attachments) > 6:
pass
else:
count = 6 - len(attachments)
db.execute("INSERT INTO attachments(att1, att2, att3, att4, att5, att6) "
"VALUES (?,?,?,?,?,?)", attachments.extend([None] * count))
lastrowid = db.execute("select last_insert_rowid()").fetchone()[0]
Эм, ты же знаешь названия полей в форме
Обсуждают сегодня