Skip to content

Commit 2e64b82

Browse files
author
Richard Jones
committed
fixed rdbms export - getnodeids in particular with NULL values
1 parent 287884f commit 2e64b82

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

roundup/admin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.44 2003-03-18 23:15:29 richard Exp $
19+
# $Id: admin.py,v 1.45 2003-03-21 04:02:12 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -953,6 +953,9 @@ def do_export(self, args):
953953
for nodeid in self.db.getclass(classname).getnodeids():
954954
# get the regular props
955955
print >>f, p.join(cl.export_list(propnames, nodeid))
956+
957+
# close this file
958+
f.close()
956959
return 0
957960

958961
def do_import(self, args):

roundup/backends/rdbms_common.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.46 2003-03-18 00:50:24 richard Exp $
1+
# $Id: rdbms_common.py,v 1.47 2003-03-21 04:02:13 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1740,12 +1740,17 @@ def getnodeids(self, retired=None):
17401740
# flip the sense of the flag if we don't want all of them
17411741
if retired is not None:
17421742
retired = not retired
1743-
sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
1744-
self.db.arg)
1743+
args = (retired, )
1744+
sql = 'select id from _%s where __retired__ <> %s'%(self.classname,
1745+
self.db.arg)
1746+
else:
1747+
args = ()
1748+
sql = 'select id from _%s'%self.classname
17451749
if __debug__:
17461750
print >>hyperdb.DEBUG, 'getnodeids', (self, sql, retired)
1747-
self.db.cursor.execute(sql, (retired,))
1748-
return [x[0] for x in self.db.cursor.fetchall()]
1751+
self.db.cursor.execute(sql, args)
1752+
ids = [x[0] for x in self.db.cursor.fetchall()]
1753+
return ids
17491754

17501755
def filter(self, search_matches, filterspec, sort=(None,None),
17511756
group=(None,None)):

0 commit comments

Comments
 (0)