Skip to content

Commit e528ea2

Browse files
author
Richard Jones
committed
force lookup of journal props in anydbm filtering
1 parent 1a0eacc commit e528ea2

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

CHANGES.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ Feature:
1010
- create a new RDBMS cursor after committing
1111
- added basic logging, and configuration of it and python's logging module
1212

13+
2004-06-10 0.7.5
14+
Fixed:
15+
- force lookup of journal props in anydbm filtering
16+
1317

14-
2004-??-?? 0.7.4
18+
2004-06-10 0.7.4
1519
Fixed:
1620
- re-acquire the OTK manager when we re-open the database
1721
- mailgw handler can close the database on us

roundup/backends/back_anydbm.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.152 2004-06-09 06:35:45 richard Exp $
18+
#$Id: back_anydbm.py,v 1.153 2004-06-10 06:54:46 richard Exp $
1919
'''This module defines a backend that saves the hyperdatabase in a
2020
database chosen by anydbm. It is guaranteed to always be available in python
2121
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1741,6 +1741,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
17411741

17421742
# add sorting information to the match entries
17431743
directions = []
1744+
JPROPS = {'actor':1, 'activity':1, 'creator':1, 'creation':1}
17441745
for dir, prop in sort, group:
17451746
if dir is None or prop is None:
17461747
continue
@@ -1760,11 +1761,16 @@ def filter(self, search_matches, filterspec, sort=(None,None),
17601761
try:
17611762
v = item[prop]
17621763
except KeyError:
1763-
# the node doesn't have a value for this property
1764-
if isinstance(propclass, Multilink): v = []
1765-
else: v = None
1766-
entry.insert(0, v)
1767-
continue
1764+
if JPROPS.has_key(prop):
1765+
# force lookup of the special journal prop
1766+
v = self.get(itemid, prop)
1767+
else:
1768+
# the node doesn't have a value for this
1769+
# property
1770+
if isinstance(propclass, Multilink): v = []
1771+
else: v = None
1772+
entry.insert(0, v)
1773+
continue
17681774

17691775
# missing (None) values are always sorted first
17701776
if v is None:

0 commit comments

Comments
 (0)