躺在沙灘上的小豬

          快樂的每一天

          #

          Django Generic Views: CRUD

          A good article about generic views:

          http://www.postneo.com/2005/08/17/django-generic-views-crud

          posted @ 2005-12-30 11:48 martin xus| 編輯 收藏

          [Django]從Request中獲取參數。

          昨天犯了個錯誤,今天補上:)

          http://www.4ya.cn/pages/viewpage.action?pageId=409


          posted @ 2005-12-30 10:24 martin xus| 編輯 收藏

          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 @ 2005-12-29 12:47 martin xus| 編輯 收藏

          more Custometing Your Confluence Spaces.

          nop

          posted @ 2005-12-22 16:10 martin xus| 編輯 收藏

          JavaScript的數組&Java中的數組

          不知道為什么,我換了IE7,編輯只有一個TextArea,其余啥都沒有了,同時在我的FireFox中,不能對代碼很好的表現。

          新弄了個Confluence把文章放那了

          http://www.4ya.cn/pages/viewpage.action?pageId=260

          posted @ 2005-12-09 22:16 martin xus| 編輯 收藏

          僅列出標題
          共28頁: First 上一頁 12 13 14 15 16 17 18 19 20 下一頁 Last 
          主站蜘蛛池模板: 延庆县| 库尔勒市| 怀集县| 略阳县| 铜川市| 蒲城县| 凌海市| 拉孜县| 郯城县| 抚顺县| 县级市| 彝良县| 南投市| 张北县| 武安市| 志丹县| 剑河县| 济南市| 南丰县| 白沙| 商南县| 南阳市| 密山市| 桑日县| 淮阳县| 屏东市| 罗田县| 庄浪县| 苍溪县| 汤原县| 嘉义县| 安远县| 阳东县| 宣化县| 缙云县| 孝昌县| 东安县| 万山特区| 青海省| 丹东市| 偏关县|