diff roundup/cgi/templating.py @ 3066:171b14d46bc3 maint-0.7

another fix to indexargs
author Richard Jones <richard@users.sourceforge.net>
date Wed, 05 Jan 2005 21:57:22 +0000
parents 4163b69f8569
children f175dcd1ad47
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Wed Jan 05 21:54:28 2005 +0000
+++ b/roundup/cgi/templating.py	Wed Jan 05 21:57:22 2005 +0000
@@ -1974,7 +1974,7 @@
             l.append(s%(sc+'group', val))
         if filter and self.filter:
             l.append(s%(sc+'filter', ','.join(self.filter)))
-        if filterspec:
+        if self.classname and filterspec:
             props = self.client.db.getclass(self.classname).getprops()
             for k,v in self.filterspec.items():
                 if type(v) == type([]):
@@ -2027,17 +2027,18 @@
             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()
-        q = urllib.quote
-        for k,v in self.filterspec.items():
-            if not args.has_key(k):
-                if type(v) == type([]):
-                    if isinstance(props[k], hyperdb.String):
-                        l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))
+        if self.classname and self.filterspec:
+            props = self.client.db.getclass(self.classname).getprops()
+            q = urllib.quote
+            for k,v in self.filterspec.items():
+                if not args.has_key(k):
+                    if type(v) == type([]):
+                        if isinstance(props[k], hyperdb.String):
+                            l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))
+                        else:
+                            l.append('%s=%s'%(k, ','.join([q(i) for i in v])))
                     else:
-                        l.append('%s=%s'%(k, ','.join([q(i) for i in v])))
-                else:
-                    l.append('%s=%s'%(k, q(v)))
+                        l.append('%s=%s'%(k, q(v)))
         return '%s?%s'%(url, '&'.join(l))
     indexargs_href = indexargs_url
 

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