<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC=1,5] >[success] # 常見的交互框 ![](https://box.kancloud.cn/33a1010622e3dfe4caea3722140e0f8c_395x179.png) ~~~ 1. input type="radio" 2. input type="checkbox" 3. input type="file" 4. input type="text" 5. select ~~~ 整體分三類,多選框,文件上傳,單選數據 >[danger] ##### 總結 ~~~ 1.單個值返回到后臺 "request.POST.get" 2.一組值返回到后臺"request.POST.getlist" 3.文件值飯后但后臺"request.FILES.get" 4.獲取文件名字用"name"屬性 5.獲取文件內容用"chunks"方法 6.注意的是想要獲取文件要在,form表單注明enctype="multipart/form-data ~~~ ![](https://box.kancloud.cn/6cc4851bedf5ce1bb7213b614c6853d4_562x111.png) >[danger] ##### 案例 ---templates 層 ~~~ <form method="post" enctype="multipart/form-data"> <table border="1px" cellspacing="0"> <thead> <th>類型</th> <th>input框</th> </thead> <tbody> <tr> <td>text 類型</td> <td><input type="text" name="texts"></td> </tr> <tr> <td> radio 類型 </td> <td> <input type="radio" name="sex" value="0">男 <input type="radio" name="sex" value="1">女 </td> </tr> <tr> <td> checkbox 類型 </td> <td> <input type="checkbox" value="1" name="habb"> 籃球 <input type="checkbox" value="2" name="habb"> 足球 </td> </tr> <tr> <td> file 類型 </td> <td> <input type="file" name="file"> </td> </tr> <tr> <td>select 類型</td> <td> <select name="city"> <option value="1">北京</option> <option value="2">大連</option> </select> </td> </tr> </tbody> </table> <input type="submit"> </form> ~~~ >[danger] ##### 案例 ---views層 ~~~ def login(request): if request.method == "POST": texts = request.POST.get('texts',None) radio_sex = request.POST.get('sex',None) check_habb = request.POST.getlist('habb',None) select_city = request.POST.get('city') print(texts) print(radio_sex) print(check_habb) print(select_city) file = request.FILES.get('file') print(file.name) with open(file.name,'wb') as f: for i in file.chunks(): f.write(i) return render(request,"index.html") ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看