Skip to content

Commit 715edb0

Browse files
author
Richard Jones
committed
ZRoundup's search interface works now [SF#994957]
1 parent d06b3bd commit 715edb0

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4+
2004-??-?? 0.7.7
5+
Fixed:
6+
- ZRoundup's search interface works now (sf bug 994957)
7+
48
2004-07-21 0.7.6
59
Fixed:
610
- rdbms backend full text search failure after import (sf bug 980314)

frontends/ZRoundup/ZRoundup.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: ZRoundup.py,v 1.17 2003-11-12 01:00:58 richard Exp $
17+
# $Id: ZRoundup.py,v 1.17.2.1 2004-07-21 04:48:41 richard Exp $
1818
#
1919
''' ZRoundup module - exposes the roundup web interface to Zope
2020
@@ -82,12 +82,33 @@ class FormWrapper:
8282
'''
8383
def __init__(self, form):
8484
self.form = form
85+
self.value = []
8586
def __getitem__(self, item):
86-
return FormItem(self.form[item])
87+
for entry in self.value:
88+
if entry.name == item:
89+
return entry
90+
entry = self.form[item]
91+
if isinstance(entry, type([])):
92+
entry = map(FormItem, entry)
93+
else:
94+
entry = FormItem(entry)
95+
return entry
96+
def getvalue(self, key, default=None):
97+
if self.form.has_key(key):
98+
return self.form[key]
99+
else:
100+
return default
87101
def has_key(self, item):
102+
for entry in self.value:
103+
if entry.name == item:
104+
return 1
88105
return self.form.has_key(item)
89106
def keys(self):
90-
return self.form.keys()
107+
l = [e.name for e in self.value]
108+
for name in self.form.keys():
109+
if name not in l:
110+
l.append(name)
111+
return l
91112

92113
class ZRoundup(Item, PropertyManager, Implicit, Persistent):
93114
'''An instance of this class provides an interface between Zope and

0 commit comments

Comments
 (0)