Skip to content

Commit b9d112b

Browse files
author
Richard Jones
committed
fixed filtering by id in anydbm
show issue ID in the headings [SF#631598]
1 parent f59ae7e commit b9d112b

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ are given with the most recent entry first.
2020
- documented dependency on Active State (sf bug 623959)
2121
- ensured there's no zero-length files in source (sf bug 633622)
2222
- added ID to the search page (sf bug 631601)
23+
- fixed filtering by id in anydbm
24+
- show issue ID in the headings (sf bug 631598)
2325

2426

2527
2002-10-16 0.5.1

roundup/backends/back_anydbm.py

Lines changed: 7 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.90 2002-10-31 04:03:48 richard Exp $
18+
#$Id: back_anydbm.py,v 1.91 2002-11-06 05:39:49 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -1591,7 +1591,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
15911591
k, entry, self.properties[k].classname)
15921592
u.append(entry)
15931593
l.append((MULTILINK, k, u))
1594-
elif isinstance(propclass, String):
1594+
elif isinstance(propclass, String) and k != 'id':
15951595
# simple glob searching
15961596
v = re.sub(r'([\|\{\}\\\.\+\[\]\(\)])', r'\\\1', v)
15971597
v = v.replace('?', '.')
@@ -1612,6 +1612,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
16121612
# now, find all the nodes that are active and pass filtering
16131613
l = []
16141614
cldb = self.db.getclassdb(cn)
1615+
print filterspec
16151616
try:
16161617
# TODO: only full-scan once (use items())
16171618
for nodeid in self.db.getnodeids(cn, cldb):
@@ -1620,6 +1621,10 @@ def filter(self, search_matches, filterspec, sort=(None,None),
16201621
continue
16211622
# apply filter
16221623
for t, k, v in filterspec:
1624+
# handle the id prop
1625+
if k == 'id' and v == nodeid:
1626+
continue
1627+
16231628
# make sure the node has the property
16241629
if not node.has_key(k):
16251630
# this node doesn't have this property, so reject it

roundup/cgi/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.55 2002-10-18 03:34:58 richard Exp $
1+
# $Id: client.py,v 1.56 2002-11-06 05:39:50 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -1189,8 +1189,6 @@ def parsePropsFromForm(db, cl, form, nodeid=0, num_re=re.compile('^\d+$')):
11891189
# of MiniFieldStorages.
11901190
value = form[key]
11911191

1192-
print (mlaction, propname, value)
1193-
11941192
# make sure non-multilinks only get one value
11951193
if not isinstance(proptype, hyperdb.Multilink):
11961194
if isinstance(value, type([])):

roundup/templates/classic/html/issue.item

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<!-- dollarId: issue.item,v 1.4 2001/08/03 01:19:43 richard Exp dollar-->
22
<tal:block metal:use-macro="templates/page/macros/icing">
3-
<title metal:fill-slot="head_title">Issue editing</title>
4-
<td class="page-header-top" metal:fill-slot="body_title"><h2>Issue Editing</h2>
3+
<title metal:fill-slot="head_title">
4+
Issue<span tal:replace="context/id" /> editing
5+
</title>
6+
<td class="page-header-top" metal:fill-slot="body_title">
7+
<h2>
8+
Issue<span tal:replace="context/id" /> Editing
9+
</h2>
510
</td>
611

712
<td class="content" metal:fill-slot="content">

roundup/templates/classic/html/issue.search

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
<tr>
5959
<th>ID:</th>
6060
<td><input name="id"></td>
61-
<td><input type="checkbox" name=":columns" value="title" checked></td>
62-
<td><input type="radio" name=":sort" value="title"></td>
61+
<td><input type="checkbox" name=":columns" value="id" checked></td>
62+
<td><input type="radio" name=":sort" value="id"></td>
6363
<td>&nbsp;</td>
6464
</tr>
6565

0 commit comments

Comments
 (0)