Mercurial > p > roundup > code
comparison roundup/backends/back_anydbm.py @ 2505:bdd112cf61ba
rdbms backend full text search failure after import [SF#980314]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 28 Jun 2004 23:13:06 +0000 |
| parents | 682eefe8ef23 |
| children | f5542d92307a |
comparison
equal
deleted
inserted
replaced
| 2504:d084aea1910f | 2505:bdd112cf61ba |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 #$Id: back_anydbm.py,v 1.157 2004-06-24 06:39:07 richard Exp $ | 18 #$Id: back_anydbm.py,v 1.158 2004-06-28 23:13:05 richard Exp $ |
| 19 '''This module defines a backend that saves the hyperdatabase in a | 19 '''This module defines a backend that saves the hyperdatabase in a |
| 20 database chosen by anydbm. It is guaranteed to always be available in python | 20 database chosen by anydbm. It is guaranteed to always be available in python |
| 21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several | 21 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several |
| 22 serious bugs, and is not available) | 22 serious bugs, and is not available) |
| 23 ''' | 23 ''' |
| 2164 # fire reactors | 2164 # fire reactors |
| 2165 self.fireReactors('set', itemid, oldvalues) | 2165 self.fireReactors('set', itemid, oldvalues) |
| 2166 return propvalues | 2166 return propvalues |
| 2167 | 2167 |
| 2168 def getprops(self, protected=1): | 2168 def getprops(self, protected=1): |
| 2169 ''' In addition to the actual properties on the node, these methods | 2169 '''In addition to the actual properties on the node, these methods |
| 2170 provide the "content" property. If the "protected" flag is true, | 2170 provide the "content" property. If the "protected" flag is true, |
| 2171 we include protected properties - those which may not be | 2171 we include protected properties - those which may not be |
| 2172 modified. | 2172 modified. |
| 2173 | |
| 2174 Note that the content prop is indexed separately, hence no indexme. | |
| 2173 ''' | 2175 ''' |
| 2174 d = Class.getprops(self, protected=protected).copy() | 2176 d = Class.getprops(self, protected=protected).copy() |
| 2175 d['content'] = hyperdb.String() | 2177 d['content'] = hyperdb.String() |
| 2176 return d | 2178 return d |
| 2179 | |
| 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) | |
| 2177 | 2191 |
| 2178 # deviation from spec - was called ItemClass | 2192 # deviation from spec - was called ItemClass |
| 2179 class IssueClass(Class, roundupdb.IssueClass): | 2193 class IssueClass(Class, roundupdb.IssueClass): |
| 2180 # Overridden methods: | 2194 # Overridden methods: |
| 2181 def __init__(self, db, classname, **properties): | 2195 def __init__(self, db, classname, **properties): |
