diff roundup/backends/back_anydbm.py @ 2437:f37f3617b9e9

force lookup of journal props in anydbm filtering
author Richard Jones <richard@users.sourceforge.net>
date Thu, 10 Jun 2004 06:54:46 +0000
parents 89072e66b5f5
children c45ed2413044
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Wed Jun 09 10:26:01 2004 +0000
+++ b/roundup/backends/back_anydbm.py	Thu Jun 10 06:54:46 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_anydbm.py,v 1.152 2004-06-09 06:35:45 richard Exp $
+#$Id: back_anydbm.py,v 1.153 2004-06-10 06:54:46 richard Exp $
 '''This module defines a backend that saves the hyperdatabase in a
 database chosen by anydbm. It is guaranteed to always be available in python
 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1741,6 +1741,7 @@
 
             # add sorting information to the match entries
             directions = []
+            JPROPS = {'actor':1, 'activity':1, 'creator':1, 'creation':1}
             for dir, prop in sort, group:
                 if dir is None or prop is None:
                     continue
@@ -1760,11 +1761,16 @@
                         try:
                             v = item[prop]
                         except KeyError:
-                            # the node doesn't have a value for this property
-                            if isinstance(propclass, Multilink): v = []
-                            else: v = None
-                            entry.insert(0, v)
-                            continue
+                            if JPROPS.has_key(prop):
+                                # force lookup of the special journal prop
+                                v = self.get(itemid, prop)
+                            else:
+                                # the node doesn't have a value for this
+                                # property
+                                if isinstance(propclass, Multilink): v = []
+                                else: v = None
+                                entry.insert(0, v)
+                                continue
 
                         # missing (None) values are always sorted first
                         if v is None:

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