On Mon, 2008-07-07 at 00:14 -0400, Mark Ramm wrote: > 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.
I use the fact that cherrypy gives me a list when I have multiple inputs in a form with the same name, and have found it really useful for fileuploads by allowing one to send a "delete current file" flag to the same validator. So I'd appreciate it sticking around in some form. I found it handy because all the values for the model attribute "something_file" can be in the same widget, share the same input name, and one validator receiving one value ( a list ) sorts out whats ultimately supposed to happen to the attribute of the model object based on the combination of values. Specifically I have a file input for uploading new, a hidden input with the old file name and a checkbox for 'delete the whole mess'. I'm not clear if this usage will be affected by what your proposing though, as it's only with form inputs that I'm using it. So, I guess I vote for the backwards compatible decorator? Thanks for listening! Iain > > Any thoughts? > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
