躺在沙灘上的小豬

          快樂的每一天

          #

          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 
          主站蜘蛛池模板: 蓝田县| 屏东县| 米林县| 邵阳市| 巢湖市| 容城县| 曲靖市| 平阳县| 遂溪县| 铜川市| 怀宁县| 武隆县| 彰化市| 普定县| 元阳县| 西和县| 泰州市| 利辛县| 文成县| 彭泽县| 缙云县| 瓦房店市| 金溪县| 深州市| 加查县| 垦利县| 宁夏| 资阳市| 新余市| 保定市| 平武县| 武城县| 旅游| 铅山县| 廉江市| 德钦县| 托克逊县| 随州市| 法库县| 泰安市| 聂荣县|