Hi
the function url (from controllers.py) as it is does not support
multiple values for the same key.
How about a change along the lines of the following patch? This would
permit to use lists as values. A list would then be translated to
multiple args with the same key and the values from the list.

--- controllers.py.old  2007-07-25 20:37:35.000000000 +0200
+++ controllers.py      2007-07-25 20:36:38.000000000 +0200
@@ -496,9 +496,14 @@
     for key, value in tgparams.iteritems():
         if value is None:
             continue
-        if isinstance(value, unicode):
-            value = value.encode("utf8")
-        args.append("%s=%s" % (k, urllib.quote(str(v))))
+        if type(value) == list:
+            pairs = [(key, v) for v in value]
+        else:
+            pairs = [(key, value)]
+        for (k,v) in pairs:
+            if isinstance(value, unicode):
+                value = value.encode("utf8")
+            args.append("%s=%s" % (k, urllib.quote(str(v))))
     if args:
         result += "?" + "&".join(args)
     return result

regards

Stefan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to