Isn't the problem that you're using args instead of request.args?
I think web2py unquotes stuff for you, but you can always use 
urllib.unquote if necessary, you don't need the htmlparser it's just a url. 
 
  
Segunda-feira, 7 de Janeiro de 2013 5:04:47 UTC, Alec Taylor escreveu:
>
> I can't figure out how to parse url quoted inputs to web2py. Here is my 
> attempt:
>
> from HTMLParser import HTMLParserfrom urllib2 import quote, unquote
>
> @service.jsondef get_group():
>     search_for = unquote(HTMLParser.unescape.__func__(HTMLParser, 
> args[0]).encode('ascii', 'ignore'))
>     our_groups_found = db.our_groups(search_for)
>     return dict(our_groups=(our_groups_found or db.our_groups(name=args[0])))
>
> How am I meant to do this?
>
> Thanks for all suggestions,
>
> Alec Taylor
>

-- 



Reply via email to