On Tue, Jan 8, 2013 at 4:25 AM, Alec Taylor <[email protected]> wrote:

> Oh oops, reduced my stuff to a test-case and forgot to fill in the rest of
> my definition.
>
> Meant to be `def get_group(*args, **kwargs)`
> [have it in a @request.restful())
>


>
> On Tue, Jan 8, 2013 at 3:12 AM, Leonel Câmara <[email protected]>wrote:
>
>> 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