From 7ba7836c04aa0cc585d5bc6969ab0ed95269c616 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 21 Mar 2003 04:02:13 +0000 Subject: [PATCH] fixed rdbms export - getnodeids in particular with NULL values git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1611 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/admin.py | 5 ++++- roundup/backends/rdbms_common.py | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/roundup/admin.py b/roundup/admin.py index 2f425c5..4521c81 100644 --- a/roundup/admin.py +++ b/roundup/admin.py @@ -16,7 +16,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: admin.py,v 1.44 2003-03-18 23:15:29 richard Exp $ +# $Id: admin.py,v 1.45 2003-03-21 04:02:12 richard Exp $ '''Administration commands for maintaining Roundup trackers. ''' @@ -953,6 +953,9 @@ Command help: for nodeid in self.db.getclass(classname).getnodeids(): # get the regular props print >>f, p.join(cl.export_list(propnames, nodeid)) + + # close this file + f.close() return 0 def do_import(self, args): diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index 8670cf3..e560629 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.46 2003-03-18 00:50:24 richard Exp $ +# $Id: rdbms_common.py,v 1.47 2003-03-21 04:02:13 richard Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -1740,12 +1740,17 @@ class Class(hyperdb.Class): # flip the sense of the 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'%(self.classname, - self.db.arg) + args = (retired, ) + sql = 'select id from _%s where __retired__ <> %s'%(self.classname, + self.db.arg) + else: + args = () + sql = 'select id from _%s'%self.classname if __debug__: print >>hyperdb.DEBUG, 'getnodeids', (self, sql, retired) - self.db.cursor.execute(sql, (retired,)) - return [x[0] for x in self.db.cursor.fetchall()] + self.db.cursor.execute(sql, args) + ids = [x[0] for x in self.db.cursor.fetchall()] + return ids def filter(self, search_matches, filterspec, sort=(None,None), group=(None,None)): -- 2.30.2