How to update value of checkbox in db using Flask

This question already has an answer here:

  • Flask isn't getting the checkbox value 1 answer
  • How to return dictionary keys as a list in Python? 9 answers
  • Check if a given key already exists in a dictionary 18 answers

  • you can convert the ImmutableMultiDict to dict

    todo = dict(request.form).keys[0]
    

    and then filter by it, complete and commit.

    链接地址: http://www.djcxy.com/p/28894.html

    上一篇: 检查密钥存在于Python字典中

    下一篇: 如何使用Flask更新数据库复选框的值