diff roundup/cgi/templating.py @ 1369:8edc52f5ceae

fixed history display code for 2.1 compatibility
author Richard Jones <richard@users.sourceforge.net>
date Mon, 13 Jan 2003 03:26:28 +0000
parents 1d1ee96e8956
children 52ef206a483b
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Mon Jan 13 02:44:42 2003 +0000
+++ b/roundup/cgi/templating.py	Mon Jan 13 03:26:28 2003 +0000
@@ -517,12 +517,12 @@
         history.sort()
         if direction == 'descending':
             history.reverse()
-            for prop_n in self._props:
+            for prop_n in self._props.keys():
                 prop = self[prop_n]
                 if isinstance(prop, HTMLProperty):
                     current[prop_n] = prop.plain()
                     # make link if hrefable
-                    if prop_n in self._props and isinstance(self._props[prop_n], hyperdb.Link):
+                    if isinstance(self._props[prop_n], hyperdb.Link):
                         classname = self._props[prop_n].classname
                         if os.path.exists(os.path.join(self._db.config.TEMPLATES, classname + '.item')):
                             current[prop_n] = '<a href="%s%s">%s</a>'%(classname,
@@ -626,40 +626,40 @@
                                 else:
                                     old = label;
                                 cell.append('%s: %s' % (k,old))
-                                if k in current:
+                                if current.has_key(k):
                                     cell[-1] += ' -> %s'%current[k]
                                     current[k] = old
 
                         elif isinstance(prop, hyperdb.Date) and args[k]:
                             d = date.Date(args[k])
                             cell.append('%s: %s'%(k, str(d)))
-                            if k in current:
+                            if current.has_key(k):
                                 cell[-1] += ' -> %s'%current[k]
                                 current[k] = str(d)
 
                         elif isinstance(prop, hyperdb.Interval) and args[k]:
                             d = date.Interval(args[k])
                             cell.append('%s: %s'%(k, str(d)))
-                            if k in current:
+                            if current.has_key(k):
                                 cell[-1] += ' -> %s'%current[k]
                                 current[k] = str(d)
 
                         elif isinstance(prop, hyperdb.String) and args[k]:
                             cell.append('%s: %s'%(k, cgi.escape(args[k])))
-                            if k in current:
+                            if current.has_key(k):
                                 cell[-1] += ' -> %s'%current[k]
                                 current[k] = cgi.escape(args[k])
 
                         elif not args[k]:
-                            if k not in current:
-                                cell.append('%s: (no value)'%k)
-                            else:
+                            if current.has_key(k):
                                 cell.append('%s: %s'%(k, current[k]))
                                 current[k] = '(no value)'
+                            else:
+                                cell.append('%s: (no value)'%k)
 
                         else:
                             cell.append('%s: %s'%(k, str(args[k])))
-                            if k in current:
+                            if current.has_key(k):
                                 cell[-1] += ' -> %s'%current[k]
                                 current[k] = str(args[k])
                     else:

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