躺在沙灘上的小豬

          快樂(lè)的每一天

          #

          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中獲取參數(shù)。

          昨天犯了個(gè)錯(cuò)誤,今天補(bǔ)上:)

          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的數(shù)組&Java中的數(shù)組

          不知道為什么,我換了IE7,編輯只有一個(gè)TextArea,其余啥都沒(méi)有了,同時(shí)在我的FireFox中,不能對(duì)代碼很好的表現(xiàn)。

          新弄了個(gè)Confluence把文章放那了

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

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

          僅列出標(biāo)題
          共28頁(yè): First 上一頁(yè) 12 13 14 15 16 17 18 19 20 下一頁(yè) Last 
          主站蜘蛛池模板: 惠州市| 玛沁县| 拜泉县| 金门县| 旬阳县| 湘潭县| 应用必备| 新密市| 嘉兴市| 项城市| 许昌县| 元阳县| 岳普湖县| 岢岚县| 徐汇区| 崇仁县| 将乐县| 安平县| 汝阳县| 灵台县| 张家港市| 金寨县| 鄯善县| 芜湖市| 孟连| 陇南市| 清远市| 梁河县| 定西市| 广宗县| 灵宝市| 南川市| 赤城县| 浮梁县| 大新县| 天峨县| 南城县| 左云县| 牙克石市| 浮山县| 蒙山县|