<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    躺在沙灘上的小豬

    快樂的每一天

    Can't get params from HttpRequest.POST

    I create a template following django's document:

    <h1>{{poll.question}}</h1>
    {%if error_message%}
    <p><strong>{{error_message}}</strong></p>{%endif%}

    <form action="/polls/{{poll.id}}/vote" method="post">
        {%for choice in poll.get_choice_list%}
            
    <input type="radio" name="choice" id="choice{{forloop.counter}}" value="{{choice.id}}"/>
            
    <label for="choice{{forloop.counter}}">{{choice.choice}}</label><br/>
        {%endfor%}
        
    <input type="submit" value="Vote">
    </form>

    And try to get params from post in python:

    def vote(request, poll_id):
        p 
    = get_object_or_404(polls, pk=poll_id)
        
    print request.GET
        
    print request.POST    
        
    return HttpResponseRedirect('/polls/%s/results/' % p.id)

    But the result was null:(

    {}
    {}

    While I change the method to get

    <form action="/polls/{{poll.id}}/vote" method="get">

    I can get the params's value.
    {'choice': ['1']}
    {}

    I don't know why,I wanna help!

    posted on 2005-12-29 12:47 martin xus 閱讀(287) 評論(1)  編輯  收藏 所屬分類: python

    主站蜘蛛池模板: 亚洲精品国产精品乱码不99| 国产免费黄色大片| 亚洲午夜国产精品无码| 七次郎成人免费线路视频| 免费一区二区三区四区五区| 另类小说亚洲色图| 免费在线观看黄网| 一级看片免费视频囗交| 国产av无码专区亚洲av果冻传媒| 国产成人无码免费网站| 亚洲色欲久久久综合网东京热| 丝瓜app免费下载网址进入ios| 亚洲免费人成在线视频观看| 日本卡1卡2卡三卡免费| 久久久久亚洲av无码专区导航 | 日本大片在线看黄a∨免费| 亚洲av无码专区首页| 亚洲AV伊人久久青青草原| 国产福利免费视频| 亚洲综合一区二区国产精品| 免费成人激情视频| 亚洲成AV人片高潮喷水| 亚洲一区二区三区在线观看精品中文| 国产午夜不卡AV免费| 亚洲免费在线视频观看| 国产乱子伦精品免费无码专区| 亚欧乱色国产精品免费视频| 国产亚洲婷婷香蕉久久精品| 国产免费一区二区三区| 麻豆91免费视频| 久久精品国产亚洲夜色AV网站| 黄色片在线免费观看| 免费国产黄网站在线观看动图 | 午夜成年女人毛片免费观看 | 久久久久免费精品国产| 亚洲另类春色校园小说| 亚洲国产精品一区二区第四页| 一个人免费视频观看在线www| 亚洲中文字幕久久精品无码2021| 免费乱码中文字幕网站| 3d成人免费动漫在线观看|