Re: question about "\d" in url pattern

2012-02-28 Thread Zheng Li
thank you very much On 2012/02/28, at 0:37, Justin Myers wrote: > On Feb 27, 1:44 am, Masklinn wrote: >> On 27 févr. 2012, at 07:23, Zheng Li wrote: >>> i thought "\d+" in url promises i can get an int point in cheer_confirm, >>> and am i wrong? >> >> \d+ ensures you will only get naturals,

Re: question about "\d" in url pattern

2012-02-27 Thread Justin Myers
On Feb 27, 1:44 am, Masklinn wrote: > On 27 févr. 2012, at 07:23, Zheng Li wrote: > > i thought "\d+" in url promises i can get an int point in cheer_confirm, > > and am i wrong? > > \d+ ensures you will only get naturals, but django will not perform any > conversion automatically. Especially n

Re: question about "\d" in url pattern

2012-02-26 Thread Masklinn
On 27 févr. 2012, at 07:23, Zheng Li wrote: > url(r'^friend_page/cheer/confirm/(?P\w+)/(?P\d+)/(?P\d+)/$', > 'cheer_confirm', name = 'friend_page'), > > def cheer_confirm(request, fid, key, point): > data = { > 'point' : 10 + point, > } > ... > > i got > Typ

question about "\d" in url pattern

2012-02-26 Thread Zheng Li
url(r'^friend_page/cheer/confirm/(?P\w+)/(?P\d+)/(?P\d+)/$', 'cheer_confirm', name = 'friend_page'), def cheer_confirm(request, fid, key, point): data = { 'point' : 10 + point, } ... i got TypeError: unsupported operand type(s) for +: 'int' and 'unicode' i d