Hello Tensio, Your code works very well. I really appreciate it!
Best Regards, -Yongzhi On Friday, April 3, 2015 at 3:33:20 AM UTC-7, tensio wrote: > > I think your URL pattern is broken. > When you want to access a URL parameter like ?id=xyz use web.input() not a > URL-pattern (http://webpy.org/cookbook/input). > So in the URLs use: > '/genplots",'genplots', > > and in the GET() method of your genplots class use: > url_data=web.input(id="no data") #the "no data" is a default value, if no > id is given > url_id = web.input().id > > And if you want to redirect to an url with an parameter use: > raise web.seeother("/genplots"+"?id="+unicode(id_you_want)) #given that > the id is an integer > > I hope this helps. If not we could help better if we had more code. > > Am Mittwoch, 1. April 2015 22:59:18 UTC+2 schrieb [email protected]: >> >> Hi all, >> >> In my case, I want to display several images according to a id. The url >> may looks like *~/genplots?id=20150401134514*. I wrote "*raise >> web.seeother('/genplots?id=%s' %(idstring))*" with " >> '*/genplots\?id=(\d*)', >> 'genplots*'". But it won't match url correctly and I got error message >> ""HTTP/1.1 GET /genplots" - 404 Not Found" with expected url in the >> browser's address field. >> >> However, if I use encoding "*raise >> web.seeother('/genplots'+'%3Fid%3D'+idstring)*", it shows correct image >> set with message ""HTTP/1.1 GET /genplots?id=20150401134514" - 200 OK". >> But the url in the browser was "~/genplots*%3F*id*%3D*20150401134725" >> rather than "~/genplots?id=20150401134725". Is there a way to fix this >> issue? I searched but didn't find proper example code. Thanks a lot. >> >> Best Regards, >> -Yongzhi >> > -- You received this message because you are subscribed to the Google Groups "web.py" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/webpy. For more options, visit https://groups.google.com/d/optout.
