url_for 不会将文本输入传递给函数

时间:2021-02-01 17:35:10

标签: python html flask jinja2

我试图将插入文本持有者的参数传递给 python 函数,但我唯一能得到的是值 None。下面是描述文本持有者和应该将参数传递给函数的 href 的代码。完整的页面代表一个结果表,如果数据库不包含评估,则插入文本保持器以允许用户手动插入。

    {% if attribute [6] is none%}
        <td align = "center"> <input type = "text" placeholder = "100" id = "info" name = "info"> </td> <br/> <br/>
    {% else%}
        <td align = "center"> {{attribute [6]}} </td>
    {% endif%}
    {% if attribute [7] is none%}
        <td align = "center"> <input type = "text" placeholder = "100" id = "written" name = "written"> </td> <br/> <br/>
    {% else%}
        <td align = "center"> {{attribute [7]}} </td>
    {% endif%}
    {% if attribute [8] is none%}
        <td align = "center"> <input type = "text" placeholder = "100" id = "oral" name = "oral"> </td> <br/> <br/>
    {% else%}
        <td align = "center"> {{attribute [8]}} </td>
    {% endif%}
        <td align = "center"> <a href = "{{url_for ('Insertresult', idGia = attribute [0], language = attribute [4], level = attribute [5], info = info, written = written, oral = oral, session = session)}} "class =" btn btn-primary "> Record outcome </td>
</tr>

问题是当我在文本框中输入一个值时,我启动了“记录结果”但它没有传递给我任何值。如果我查找 p 值,它已插入页面中,因为它存在于数据库中,例如我将属性 [6] 分配给信息,然后按下“记录结果”,我可以看到该值。 我做错了什么?

0 个答案:

没有答案