Skip to content

Commit ab9c395

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent d74c12e commit ab9c395

File tree

4 files changed

+53
-12
lines changed

4 files changed

+53
-12
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
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.6
5+
Fixed:
6+
- rdbms backend full text search failure after import (sf bug 980314)
7+
8+
49
2004-06-24 0.7.5
510
Fixed:
611
- force lookup of journal props in anydbm filtering

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Gus Gollings,
8989
Dan Grassi,
9090
Engelbert Gruber,
9191
Juergen Hermann,
92+
Uwe Hoffmann,
9293
Tobias Hunger,
9394
Simon Hyde,
9495
Christophe Kalt,

roundup/backends/back_anydbm.py

Lines changed: 19 additions & 5 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.11 2004-06-24 07:14:26 richard Exp $
18+
#$Id: back_anydbm.py,v 1.146.2.12 2004-06-28 23:15:39 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
@@ -2166,15 +2166,29 @@ def set(self, itemid, **propvalues):
21662166
return propvalues
21672167

21682168
def getprops(self, protected=1):
2169-
''' In addition to the actual properties on the node, these methods
2170-
provide the "content" property. If the "protected" flag is true,
2171-
we include protected properties - those which may not be
2172-
modified.
2169+
'''In addition to the actual properties on the node, these methods
2170+
provide the "content" property. If the "protected" flag is true,
2171+
we include protected properties - those which may not be
2172+
modified.
2173+
2174+
Note that the content prop is indexed separately, hence no indexme.
21732175
'''
21742176
d = Class.getprops(self, protected=protected).copy()
21752177
d['content'] = hyperdb.String()
21762178
return d
21772179

2180+
def index(self, nodeid):
2181+
'''Add (or refresh) the node to search indexes.
2182+
2183+
Pass on the content-type property for the content property.
2184+
'''
2185+
Class.index(self, nodeid)
2186+
mimetype = self.get(nodeid, 'type')
2187+
if not mimetype:
2188+
mimetype = self.default_mime_type
2189+
self.db.indexer.add_text((self.classname, nodeid, 'content'),
2190+
self.get(nodeid, 'content'), mimetype)
2191+
21782192
# deviation from spec - was called ItemClass
21792193
class IssueClass(Class, roundupdb.IssueClass):
21802194
# Overridden methods:

roundup/backends/rdbms_common.py

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.11 2004-06-24 07:14:48 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.12 2004-06-28 23:15:39 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2421,7 +2421,10 @@ def import_list(self, propnames, proplist):
24212421
# make the new node's property map
24222422
d = {}
24232423
retire = 0
2424-
newid = None
2424+
if not "id" in propnames:
2425+
newid = self.db.newid(self.classname)
2426+
else:
2427+
newid = eval(proplist[propnames.index("id")])
24252428
for i in range(len(propnames)):
24262429
# Use eval to reverse the repr() used to output the CSV
24272430
value = eval(proplist[i])
@@ -2431,7 +2434,6 @@ def import_list(self, propnames, proplist):
24312434

24322435
# "unmarshal" where necessary
24332436
if propname == 'id':
2434-
newid = value
24352437
continue
24362438
elif propname == 'is retired':
24372439
# is the item retired?
@@ -2455,6 +2457,11 @@ def import_list(self, propnames, proplist):
24552457
pwd.unpack(value)
24562458
value = pwd
24572459
d[propname] = value
2460+
if isinstance(prop, String) and prop.indexme:
2461+
if type(value) != type('') and type(value) != type(u''):
2462+
raise TypeError, 'new property "%s" not a string'%key
2463+
self.db.indexer.add_text((self.classname, newid, propname),
2464+
value)
24582465

24592466
# get a new id if necessary
24602467
if newid is None:
@@ -2595,10 +2602,12 @@ def get(self, nodeid, propname, default=_marker, cache=1):
25952602
return Class.get(self, nodeid, propname)
25962603

25972604
def getprops(self, protected=1):
2598-
''' In addition to the actual properties on the node, these methods
2599-
provide the "content" property. If the "protected" flag is true,
2600-
we include protected properties - those which may not be
2601-
modified.
2605+
'''In addition to the actual properties on the node, these methods
2606+
provide the "content" property. If the "protected" flag is true,
2607+
we include protected properties - those which may not be
2608+
modified.
2609+
2610+
Note that the content prop is indexed separately, hence no indexme.
26022611
'''
26032612
d = Class.getprops(self, protected=protected).copy()
26042613
d['content'] = hyperdb.String()
@@ -2633,6 +2642,18 @@ def set(self, itemid, **propvalues):
26332642
self.fireReactors('set', itemid, oldvalues)
26342643
return propvalues
26352644

2645+
def index(self, nodeid):
2646+
'''Add (or refresh) the node to search indexes.
2647+
2648+
Pass on the content-type property for the content property.
2649+
'''
2650+
Class.index(nodeid)
2651+
mime_type = self.get(itemid, 'type')
2652+
if not mime_type:
2653+
mime_type = self.default_mime_type
2654+
self.db.indexer.add_text((self.classname, nodeid, 'content'),
2655+
str(self.get(nodeid, 'content')), mime_type)
2656+
26362657
# XXX deviation from spec - was called ItemClass
26372658
class IssueClass(Class, roundupdb.IssueClass):
26382659
# Overridden methods:

0 commit comments

Comments
 (0)