diff roundup/backends/back_anydbm.py @ 1303:71be6588904f

fixed filtering by id in anydbm show issue ID in the headings [SF#631598]
author Richard Jones <richard@users.sourceforge.net>
date Wed, 06 Nov 2002 05:39:50 +0000
parents 34b1e6490e65
children 61ad556cfc8d
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Wed Nov 06 04:24:24 2002 +0000
+++ b/roundup/backends/back_anydbm.py	Wed Nov 06 05:39:50 2002 +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.90 2002-10-31 04:03:48 richard Exp $
+#$Id: back_anydbm.py,v 1.91 2002-11-06 05:39:49 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
@@ -1591,7 +1591,7 @@
                                 k, entry, self.properties[k].classname)
                     u.append(entry)
                 l.append((MULTILINK, k, u))
-            elif isinstance(propclass, String):
+            elif isinstance(propclass, String) and k != 'id':
                 # simple glob searching
                 v = re.sub(r'([\|\{\}\\\.\+\[\]\(\)])', r'\\\1', v)
                 v = v.replace('?', '.')
@@ -1612,6 +1612,7 @@
         # now, find all the nodes that are active and pass filtering
         l = []
         cldb = self.db.getclassdb(cn)
+        print filterspec
         try:
             # TODO: only full-scan once (use items())
             for nodeid in self.db.getnodeids(cn, cldb):
@@ -1620,6 +1621,10 @@
                     continue
                 # apply filter
                 for t, k, v in filterspec:
+                    # handle the id prop
+                    if k == 'id' and v == nodeid:
+                        continue
+
                     # make sure the node has the property
                     if not node.has_key(k):
                         # this node doesn't have this property, so reject it

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