From: wc2so1 Date: Tue, 27 Jan 2004 18:10:48 +0000 (+0000) Subject: Changed to 1.56 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33be8fe18df521264f0d5875f84e8579a92a83ea;p=roundup.git Changed to 1.56 13 worked-around a current metakit bug, so retiring properties now works correctly. metakit 2.9.2 has a bug when using "find" on ordered views, using multiple arguments for find doesn't work. Known Current Bugs: You can't change a class' key properly. This shouldn't be too hard to fix. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2063 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_metakit.py b/roundup/backends/back_metakit.py index 190e644..201dd4e 100755 --- a/roundup/backends/back_metakit.py +++ b/roundup/backends/back_metakit.py @@ -1,4 +1,4 @@ -# $Id: back_metakit.py,v 1.56 2004-01-26 17:07:56 wc2so1 Exp $ +# $Id: back_metakit.py,v 1.57 2004-01-27 18:10:48 wc2so1 Exp $ ''' Metakit backend for Roundup, originally by Gordon McMillan. @@ -94,27 +94,16 @@ BACKWARDS_COMPATIBLE = True # 12 Enumerated READ and READWRITE for the getview and getindexedview # These will probably be removed because they are not used # -# Known Current Bugs: -# It is currently is not possible to retire an id with name X -# and add a new unretired property with name X. -# Confused? Here is the regression test: -# -# self.assertRaises(ValueError, self.db.user.create) +# Changed to 1.56 # -# newid = self.db.user.create(username="spam") -# self.assertEqual(self.db.user.lookup('spam'), newid) -# self.db.commit() -# self.assertEqual(self.db.user.lookup('spam'), newid) -# self.db.user.retire(newid) -# self.assertRaises(KeyError, self.db.user.lookup, 'spam') +# 13 worked-around a current metakit bug, so retiring properties now +# works correctly. +# metakit 2.9.2 has a bug when using "find" on ordered views, +# using multiple arguments for find doesn't work. # -# # use the key again now that the old is retired (metakit FAILS!!) -# newid2 = self.db.user.create(username="spam") -# self.assertNotEqual(newid, newid2) -# # try to restore old node. this shouldn't succeed! -# self.assertRaises(KeyError, self.db.user.restore, newid) -# -# self.assertRaises(TypeError, self.db.issue.lookup, 'fubar') +# Known Current Bugs: +# You can't change a class' key properly. +# This shouldn't be too hard to fix. # from roundup import hyperdb, date, password, roundupdb, security @@ -475,7 +464,7 @@ class Class(hyperdb.Class): ''' 'cache' exists for backwards compatibility, and is not used. ''' - view = self.getview() + view = self.getview() id = int(nodeid) if cache == 0: oldnode = self.uncommitted.get(id, None) @@ -784,9 +773,13 @@ class Class(hyperdb.Class): self.db.addjournal(self.classname, nodeid, _RETIRE, {}) if self.key: iv = self.getindexview(READWRITE) - ndx = iv.find(k=getattr(row, self.key),i=row.id) - if ndx > -1: + ndx = iv.find(k=getattr(row, self.key)) + # find is broken with multiple attribute lookups + # on ordered views + #ndx = iv.find(k=getattr(row, self.key),i=row.id) + if ndx > -1 and iv[ndx].i == row.id: iv.delete(ndx) + self.db.dirty = 1 self.fireReactors('retire', nodeid, None)