And I dont like the trailing underscore idea, because it would be a
mess to deal with in most common use cases like:
params = dict(request.params)
url = url_for('/page', **params)
With the params dict suggestion this will be written into
url = url_for('/page', params)
But with trailing underscore you would have to do some ugly (and
expensive) manipulation:
for key in params.keys():
new_key = key + '_'
params[new_key] = params[key]
del params[key]
url = url_for('/page', **params)
That is horrible
On Jan 5, 12:18 pm, Tycon <[email protected]> wrote:
> and users can easily concatenate the query string to the url by
> themselves, so not much point to allow that option. I like the params
> dict suggestion.
>
> On Jan 5, 12:11 pm, Wyatt Baldwin <[email protected]> wrote:
>
> > On Jan 5, 11:57 am, "Mike Orr" <[email protected]> wrote:
>
> > > On Mon, Jan 5, 2009 at 11:13 AM, Wyatt Baldwin
>
> > > [snip]
>
> > > > Actually, I think I like the idea of making the query params into a
> > > > single argument. It could be a string like a=1&b=2 or a dict.
>
> > > No! Encouraging the user to do their own interpolation and escaping
> > > would be a step back into the Dark Ages.
>
> > Sorry if I'm being daft, but you're only vehemently (!) opposing
> > ``params`` as a *string*, correct?
>
> > I see your point there, and I can't think of a case where I'd need or
> > want to use a str instead of a dict--except maybe where the query
> > string came from elsewhere, but that seems like a fairly unusual case.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---