> It seems that some folks were actually using the feature of CherryPy > which turned ?name=Edu&name=Roger&name=Mark into a > name=['Roger','Mark] parameter. > > I tend to think this feature is a little bit strange because if for > some reason I only wanted to pass up name=Mark I'd get a string not a > list as the name param. > > In TG2 we're just passing along name="Roger" in the above case but > other name elements are available from the request.GET multidict: > > http://pythonpaste.org/webob/index.html#multidict > > So you could do: > > request.GET.getall('name') > > Which will return the list ('Roger', 'Mark) and will *always* return a > tuple, so there's no ambiguity. > > TG2 could add a "compatibility mode" that makes these things happen, > or we could use a decorator to give us a more backwards compatible way > of working, but I rather like the fact that I can predict what I'm > getting the current way, so I'm a bit hesitant to go too far down that > road without some more significant feedback from users. > > Any thoughts?
I never used multiple arguments with the same name and so never expected to get a list. The reason is the same as you say, it's better to keep things well-defined and clean, one name, one argument, one value. So I wouldn't mind forbidding this practice and having always just one name: value pair for a given name. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
