On Sat, Nov 1, 2008 at 5:03 PM, Anand Chitipothu <[EMAIL PROTECTED]>wrote:
>
> On Sun, Nov 2, 2008 at 5:29 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> > On Sat, Nov 1, 2008 at 4:58 PM, Anand Chitipothu <[EMAIL PROTECTED]>
> > wrote:
> >>
> >> > also, i do some processing on the web.input :
> >> >
> >> > next = web.ctx.path + '?' +
> >> > urllib.urlencode(utils.removeitems(web.input()))
> >> why not use web.changequery?
> >
> > i need to remove some items in that are in web.input(), not change them
> web.changequery(x=None) removes x from the query string.
>
how do i do something like this in web.changequery?
def removeitems(d, prefix=['fb_sig', 'auth_token']):
new_dict = {}
for k,v in d.items():
if hasattr(k, 'startswith'):
for p in prefix:
if k.startswith(p):
continue
new_dict[k] = v
return web.Storage(new_dict)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---