[Pyramid] route_url _query None value behavior

2011-05-21 Thread Jerry
Hi, Pyramid's route_url/route_path behavior with None _query terms doesn't seem very canonical to me -- (Pdb) request.route_path('home', _query=[('q', None)]) '/home?q=None' Omitting value is more like it -- (Pdb) request.route_path('home', _query=[('q', '')]) '/home?q=' so is omitting both

Re: route_url _query None value behavior

2011-05-21 Thread Jerry
Google group messes with the formatting, which should have been -- else: if v.__class__ is unicode: v = v.encode('utf-8') if v: v = quote_plus(str(v)) result += '%s%s=%s' % (prefix, k, v) else: result += '%s%s=' % (prefix, k) Jerry On May 22, 9:32 am,

Re: route_url _query None value behavior

2011-05-21 Thread Chris McDonough
Don't think this is really right if you consider the desire to be able to pass integers (like 0), which others have requested before. What precedent is there to passing the value None being converted to empty string? - C On Sat, 2011-05-21 at 18:35 -0700, Jerry wrote: Google group messes with