diff roundup/cgi/templating.py @ 3049:393f6ab17c07

handle spaces in String index params in batching [SF#1054224]
author Richard Jones <richard@users.sourceforge.net>
date Tue, 04 Jan 2005 01:44:29 +0000
parents 14322134dcef
children 53d1d4e2015c
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Tue Jan 04 01:38:12 2005 +0000
+++ b/roundup/cgi/templating.py	Tue Jan 04 01:44:29 2005 +0000
@@ -2020,9 +2020,13 @@
         if filter and self.filter:
             l.append(s%(sc+'filter', ','.join(self.filter)))
         if filterspec:
+            props = self.client.db.getclass(self.classname).getprops()
             for k,v in self.filterspec.items():
                 if type(v) == type([]):
-                    l.append(s%(k, ','.join(v)))
+                    if isinstance(props[k], hyperdb.String):
+                        l.append(s%(k, ' '.join(v)))
+                    else:
+                        l.append(s%(k, ','.join(v)))
                 else:
                     l.append(s%(k, v))
         if self.search_text:
@@ -2068,10 +2072,14 @@
             l.append(sc+'startwith=%s'%self.startwith)
 
         # finally, the remainder of the filter args in the request
+        props = self.client.db.getclass(self.classname).getprops()
         for k,v in self.filterspec.items():
             if not args.has_key(k):
                 if type(v) == type([]):
-                    l.append('%s=%s'%(k, ','.join(v)))
+                    if isinstance(props[k], hyperdb.String):
+                        l.append(s%(k, ' '.join(v)))
+                    else:
+                        l.append(s%(k, ','.join(v)))
                 else:
                     l.append('%s=%s'%(k, v))
         return '%s?%s'%(url, '&'.join(l))

Roundup Issue Tracker: http://roundup-tracker.org/