diff roundup/backends/back_metakit.py @ 930:3c344e942055

Use same regex to split search terms as used to index text. Fix to back_metakit for not changing journaltag on reopen. Fix htmltemplate's do_link so [No <whatever>] strings are href'd. Fix bogus "nosy edited ok" msg - the **d syntax does NOT share d between caller and callee.
author Gordon B. McMillan <gmcm@users.sourceforge.net>
date Thu, 01 Aug 2002 15:06:26 +0000
parents 51519406b73e
children 1798d2fa9fec
line wrap: on
line diff
--- a/roundup/backends/back_metakit.py	Thu Aug 01 01:07:37 2002 +0000
+++ b/roundup/backends/back_metakit.py	Thu Aug 01 15:06:26 2002 +0000
@@ -12,6 +12,12 @@
     if db is None or db._db is None:
         db = _Database(config, journaltag)
         _dbs[config.DATABASE] = db
+    else:
+        db.journaltag = journaltag
+        try:
+            delattr(db, 'curuserid')
+        except AttributeError:
+            pass
     return db
 
 class _Database(hyperdb.Database):
@@ -273,7 +279,7 @@
         if not isnew:
             self.fireAuditors('set', nodeid, propvalues)
         if not propvalues:
-            return
+            return propvalues
         if propvalues.has_key('id'):
             raise KeyError, '"id" is reserved'
         if self.db.journaltag is None:
@@ -328,6 +334,9 @@
                 if value is not None and not isinstance(value, type('')):
                     raise ValueError, 'property "%s" link value be a string'%(
                         propname)
+                # Roundup sets to "unselected" by passing None
+                if value is None:
+                    value = 0   
                 # if it isn't a number, it's a key
                 try:
                     int(value)
@@ -408,6 +417,8 @@
                 for id in adds:
                     sv.append(fid=int(id))
                 changes[key] = oldvalue
+                if not rmvd and not adds:
+                    del propvalues[key]
                     
 
             elif isinstance(prop, hyperdb.String):
@@ -456,7 +467,7 @@
 
         # nothing to do?
         if not propvalues:
-            return
+            return propvalues
         if not propvalues.has_key('activity'):
             row.activity = int(time.time())
         if isnew:
@@ -474,6 +485,8 @@
                 self.db.addjournal(self.classname, nodeid, _SET, changes)
                 self.fireReactors('set', nodeid, oldnode)
 
+        return propvalues
+    
     def retire(self, nodeid):
         self.fireAuditors('retire', nodeid, None)
         view = self.getview(1)

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