Skip to content

Commit 1fcedf6

Browse files
author
Richard Jones
committed
another fix to indexargs
1 parent 470babd commit 1fcedf6

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Fixed:
5959
- removed safeget() from the API (sf bug 994750)
6060
- demo tracker is always set up on localhost (sf bug 1049101)
6161

62+
6263
2004-10-06 0.7.11
6364
Fixed:
6465
- index args URL generation broken in .10 (sf bug 1096027)

roundup/cgi/templating.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@ def indexargs_form(self, columns=1, sort=1, group=1, filter=1,
20192019
l.append(s%(sc+'group', val))
20202020
if filter and self.filter:
20212021
l.append(s%(sc+'filter', ','.join(self.filter)))
2022-
if filterspec:
2022+
if self.classname and filterspec:
20232023
props = self.client.db.getclass(self.classname).getprops()
20242024
for k,v in self.filterspec.items():
20252025
if type(v) == type([]):
@@ -2072,17 +2072,18 @@ 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+
l.append('%s=%s'%(k, q(v)))
20862087
return '%s?%s'%(url, '&'.join(l))
20872088
indexargs_href = indexargs_url
20882089

0 commit comments

Comments
 (0)