【问题标题】:python dynamic checkbox request formpython动态复选框请求表单
【发布时间】:2016-05-24 18:30:19
【问题描述】:

您好,我用这个创建了一个输入动态复选框

 {% for row in servit %}
    <label title='{{row.Descrizione}}'>{{row.Nome}}</label>
    <input type="checkbox" name="{{row.Nome}}a">Attivo
    <input type="checkbox" name="{{row.Nome}}p">passivo
 {% endfor %}

它有效。 我想在 python 中调用表单,我尝试过这样做:

    for row in test:
        testa=row.Nome+"a"
        testfa=str(request.form["testa"])

但是没有结果,我怎么能做我需要的,我怎么能在 request.form 里面放一个变量?

【问题讨论】:

    标签: python forms checkbox


    【解决方案1】:

    好的,我自己找到了解决办法

    testfa =request.form.get(testa)
    

    【讨论】:

      猜你喜欢
      • 2018-03-18
      • 2023-03-17
      • 2017-12-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-16
      • 2011-10-24
      • 2018-03-20
      • 1970-01-01
      相关资源
      最近更新 更多