Skip to content

Commit e701212

Browse files
author
Richard Jones
committed
backport from HEAD
1 parent e22b64a commit e701212

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ are given with the most recent entry first.
55
Fixed:
66
- add "checked" to truth values for Boolean input
77
- fixed import in metakit backend
8+
- fix SearchAction use of Class.filter(), and clarify API docs for same
89

910

1011
2004-05-17 0.7.2

roundup/backends/back_anydbm.py

Lines changed: 2 additions & 2 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.146.2.2 2004-05-16 09:33:13 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.3 2004-05-23 23:26:29 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
@@ -1579,7 +1579,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
15791579
"sort" and "group" are (dir, prop) where dir is '+', '-' or None
15801580
and prop is a prop name or None
15811581
1582-
"search_matches" is {nodeid: marker}
1582+
"search_matches" is {nodeid: marker} or None
15831583
15841584
The filter must match all properties specificed - but if the
15851585
property value to match is a list, any one of the values in the

roundup/backends/back_metakit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.70.2.1 2004-05-18 22:06:08 richard Exp $
1+
# $Id: back_metakit.py,v 1.70.2.2 2004-05-23 23:26:29 richard Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -1174,7 +1174,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
11741174
"sort" and "group" are (dir, prop) where dir is '+', '-' or None
11751175
and prop is a prop name or None
11761176
1177-
"search_matches" is {nodeid: marker}
1177+
"search_matches" is {nodeid: marker} or None
11781178
11791179
The filter must match all properties specificed - but if the
11801180
property value to match is a list, any one of the values in the

roundup/backends/back_mysql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
499499
"sort" and "group" are (dir, prop) where dir is '+', '-' or None
500500
and prop is a prop name or None
501501
502-
"search_matches" is {nodeid: marker}
502+
"search_matches" is {nodeid: marker} or None
503503
504504
The filter must match all properties specificed - but if the
505505
property value to match is a list, any one of the values in the

roundup/backends/rdbms_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.3 2004-05-16 22:00:08 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.4 2004-05-23 23:26:29 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1991,7 +1991,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
19911991
"sort" and "group" are (dir, prop) where dir is '+', '-' or None
19921992
and prop is a prop name or None
19931993
1994-
"search_matches" is {nodeid: marker}
1994+
"search_matches" is {nodeid: marker} or None
19951995
19961996
The filter must match all properties specificed - but if the
19971997
property value to match is a list, any one of the values in the

roundup/cgi/actions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: actions.py,v 1.27.2.1 2004-05-13 00:21:32 richard Exp $
1+
#$Id: actions.py,v 1.27.2.2 2004-05-23 23:26:30 richard Exp $
22

33
import re, cgi, StringIO, urllib, Cookie, time, random
44

@@ -148,18 +148,20 @@ def handle(self, wcre=re.compile(r'[\s,]+')):
148148
# edit the new way, query name not a key any more
149149
# see if we match an existing private query
150150
uid = self.db.getuid()
151-
qids = self.db.query.filter({}, {'name': queryname,
151+
qids = self.db.query.filter(None, {'name': queryname,
152152
'private_for': uid})
153153
if not qids:
154154
# ok, so there's not a private query for the current user
155155
# - see if there's a public one created by them
156-
qids = self.db.query.filter({}, {'name': queryname,
156+
qids = self.db.query.filter(None, {'name': queryname,
157157
'private_for': -1, 'creator': uid})
158158

159159
if qids:
160-
# edit query
161-
qid = qids[0]
162-
self.db.query.set(qid, klass=self.classname, url=url)
160+
# edit query - make sure we get an exact match on the name
161+
for qid in qids:
162+
if queryname != self.db.query.get(qid, 'name'):
163+
continue
164+
self.db.query.set(qid, klass=self.classname, url=url)
163165
else:
164166
# create a query
165167
qid = self.db.query.create(name=queryname,

0 commit comments

Comments
 (0)