changeset 1709:44319ba5a7a7 maint-0.5

Fixed Py2.3 compatibility. This code was broken for the case where getnodeids was called with 'retired=None' (which means that we want retired and unretired ids). No test case for it - I'm still trying to work out the best way to do it.
author Anthony Baxter <anthonybaxter@users.sourceforge.net>
date Tue, 24 Jun 2003 08:18:19 +0000
parents 798247746257
children 139e9eae9041
files roundup/backends/rdbms_common.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Tue Jun 24 06:51:06 2003 +0000
+++ b/roundup/backends/rdbms_common.py	Tue Jun 24 08:18:19 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.27.2.8 2003-03-24 04:53:14 richard Exp $
+# $Id: rdbms_common.py,v 1.27.2.9 2003-06-24 08:18:19 anthonybaxter Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -720,13 +720,16 @@
             Set retired=None to get all nodes. Otherwise it'll get all the 
             retired or non-retired nodes, depending on the flag.
         '''
-        # flip the sense of the flag if we don't want all of them
+        # flip the sense of the 'retired' flag if we don't want all of them
         if retired is not None:
-            retired = not retired
-        sql = 'select id from _%s where __retired__ <> %s'%(classname, self.arg)
+            args = (((retired==0) and 1) or 0,)
+            sql = 'select id from _%s where __retired__ <> %s'%(classname, self.arg)
+        else:
+            args = ()
+            sql = 'select id from _%s'%(classname,)
         if __debug__:
-            print >>hyperdb.DEBUG, 'getnodeids', (self, sql, retired)
-        self.cursor.execute(sql, (retired,))
+            print >>hyperdb.DEBUG, 'getnodeids', (self, sql, args)
+        self.cursor.execute(sql, args)
         return [x[0] for x in self.cursor.fetchall()]
 
     def addjournal(self, classname, nodeid, action, params, creator=None,

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