#899: turbogears.url misunderstands same-name fields from cherrypy.paramMap
-----------------------+----------------------------------------------------
 Reporter:  anonymous  |       Owner:  anonymous
     Type:  defect     |      Status:  new      
 Priority:  normal     |   Milestone:           
Component:  CherryPy   |     Version:  0.9a1    
 Severity:  minor      |    Keywords:           
-----------------------+----------------------------------------------------
 I have a login page which users get redirected to, which rebuilds the
 original URL using

 previous_url=turbogears.url(cherrypy.request.path,cherrypy.request.paramMap)

 this fails when you have e.g.

 http://mysite/wherever?a=4&a=7

 because paramMap joins these into a list {a:[4,7]}
 and turbogears.url encodes the list as a string, so turbogears.url
 produces (an escaped version of)

 http://mysite/wherever?a=[4,7]

 it looks like in turbogears/controllers.py you'd need something like
 {{{
  489    for key, value in tgparams.iteritems():
            if not isinstance(value,list):
                 value=[value]
            for subvalue in value:
  490            if subvalue is None:
  491                continue
  492            if isinstance(subvalue, unicode):
  493                value = subvalue.encode("utf8")
  494            args.append("%s=%s" % (key, urllib.quote(str(subvalue))))
 }}}
 that's probably bad programming but you get the idea. I haven't
 experimented with what cherrypy.paramMap does in more obscure cases.

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/899>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to