diff roundup/backends/rdbms_common.py @ 1476:5a01e90b7dc9

fixed export/import of retired nodes [SF#685273]
author Richard Jones <richard@users.sourceforge.net>
date Wed, 26 Feb 2003 23:42:54 +0000
parents 378081f066cc
children 405e91b5be46
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Wed Feb 26 21:10:21 2003 +0000
+++ b/roundup/backends/rdbms_common.py	Wed Feb 26 23:42:54 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: rdbms_common.py,v 1.35 2003-02-25 10:19:32 richard Exp $
+# $Id: rdbms_common.py,v 1.36 2003-02-26 23:42:54 richard Exp $
 ''' Relational database (SQL) backend common code.
 
 Basics:
@@ -1143,6 +1143,7 @@
             elif isinstance(proptype, hyperdb.Password):
                 value = str(value)
             l.append(repr(value))
+        l.append(self.is_retired(nodeid))
         return l
 
     def import_list(self, propnames, proplist):
@@ -1184,6 +1185,16 @@
                 value = pwd
             d[propname] = value
 
+        # retire?
+        if int(proplist[-1]):
+            # use the arg for __retired__ to cope with any odd database type
+            # conversion (hello, sqlite)
+            sql = 'update _%s set __retired__=%s where id=%s'%(self.classname,
+                self.db.arg, self.db.arg)
+            if __debug__:
+                print >>hyperdb.DEBUG, 'retire', (self, sql, newid)
+            self.db.cursor.execute(sql, (1, newid))
+
         # add the node and journal
         self.db.addnode(self.classname, newid, d)
 

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