开发者

Passing an array in django urls

开发者 https://www.devze.com 2023-01-12 01:27 出处:网络
Can we pass an array to a django url <script> function save() { window.location = \"/display/xlsdisplay/\" + objarr ;

Can we pass an array to a django url

   <script>
     function save()
     {
       window.location = "/display/xlsdisplay/" + objarr ;   
     }

    var objarr = new Array();

    </script>

Urls.py

         (r'^xlsdisplay/(?P<qid>\开发者_JAVA百科d+)$', 'xlsdisplay'),

There is an error saying

             http://192.168.1.11/display/xlsdisplay/334,335,336,337,338,339,340,341,342,343


  1. The regular expression used in your URL will only match a sequence of digits. The comma will require a different expression.
  2. I don't know your specific need but you ought to look at naming URLs rather than hard cording them.
0

精彩评论

暂无评论...
验证码 换一张
取 消