diff roundup/backends/back_metakit.py @ 1912:2b0ab61db194

fixes for [SF#818339] fixes for metakit for the new db unit tests
author Richard Jones <richard@users.sourceforge.net>
date Wed, 12 Nov 2003 03:42:13 +0000
parents 91a4619b1a14
children f9316d2cd5ba
line wrap: on
line diff
--- a/roundup/backends/back_metakit.py	Wed Nov 12 01:00:59 2003 +0000
+++ b/roundup/backends/back_metakit.py	Wed Nov 12 03:42:13 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: back_metakit.py,v 1.51 2003-10-07 11:58:57 anthonybaxter Exp $
+# $Id: back_metakit.py,v 1.52 2003-11-12 03:42:12 richard Exp $
 '''
    Metakit backend for Roundup, originally by Gordon McMillan.
 
@@ -140,7 +140,7 @@
         if tblid == -1:
             tblid = self.tables.append(name=tablenm)
         if creator is None:
-            creator = self.getuid()
+            creator = int(self.getuid())
         else:
             try:
                 creator = int(creator)
@@ -628,7 +628,7 @@
             if not row.creation:
                 row.creation = int(time.time())
             if not row.creator:
-                row.creator = self.db.getuid()
+                row.creator = int(self.db.getuid())
 
         self.db.dirty = 1
         if self.do_journal:
@@ -734,6 +734,11 @@
         if not isinstance(prop, hyperdb.String):
             raise TypeError, "%s is not a String" % propname
 
+        # TODO: metakit needs to be able to cope with the key property
+        # *changing*, which it can't do at present. At the moment, it
+        # creates the key prop index once, with no record of the name of
+        # the property for the index.
+
         # first setkey for this run
         self.keyname = propname
         iv = self.db._db.view('_%s' % self.classname)
@@ -814,7 +819,10 @@
             else:
                 d = {}
                 for id in ids.keys():
-                    d[int(id)] = 1
+                    if id is None:
+                        d[0] = 1
+                    else:
+                        d[int(id)] = 1
                 ids = d
             prop = self.ruprops[propname]
             view = self.getview()

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