Skip to content

Commit 4efed5d

Browse files
author
Richard Jones
committed
another fix to indexargs
1 parent 359b5d3 commit 4efed5d

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

roundup/cgi/templating.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,18 +2072,19 @@ def indexargs_url(self, url, args):
20722072
l.append(sc+'startwith=%s'%self.startwith)
20732073

20742074
# finally, the remainder of the filter args in the request
2075-
props = self.client.db.getclass(self.classname).getprops()
2076-
q = urllib.quote
2077-
for k,v in self.filterspec.items():
2078-
if not args.has_key(k):
2079-
if type(v) == type([]):
2080-
if isinstance(props[k], hyperdb.String):
2081-
l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))
2075+
if self.classname and self.filterspec:
2076+
props = self.client.db.getclass(self.classname).getprops()
2077+
q = urllib.quote
2078+
for k,v in self.filterspec.items():
2079+
if not args.has_key(k):
2080+
if type(v) == type([]):
2081+
if isinstance(props[k], hyperdb.String):
2082+
l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))
2083+
else:
2084+
l.append('%s=%s'%(k, ','.join([q(i) for i in v])))
20822085
else:
2083-
l.append('%s=%s'%(k, ','.join([q(i) for i in v])))
2084-
else:
2085-
l.append('%s=%s'%(k, q(v)))
2086-
return '%s?%s'%(url, '&'.join(l))
2086+
l.append('%s=%s'%(k, q(v)))
2087+
return '%s?%s'%(url, '&'.join(l))
20872088
indexargs_href = indexargs_url
20882089

20892090
def base_javascript(self):

0 commit comments

Comments
 (0)