comparison roundup/hyperdb.py @ 749:51c425129b35

Merged search_indexing-branch with HEAD
author Roche Compaan <rochecompaan@users.sourceforge.net>
date Sat, 25 May 2002 07:16:25 +0000
parents b0d887310f7a
children e7b89de78052
comparison
equal deleted inserted replaced
748:2e70123bbf5a 749:51c425129b35
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: hyperdb.py,v 1.65 2002-05-22 04:12:05 richard Exp $ 18 # $Id: hyperdb.py,v 1.66 2002-05-25 07:16:24 rochecompaan Exp $
19 19
20 __doc__ = """ 20 __doc__ = """
21 Hyperdatabase implementation, especially field types. 21 Hyperdatabase implementation, especially field types.
22 """ 22 """
23 23
843 l.append(nodeid) 843 l.append(nodeid)
844 l.sort() 844 l.sort()
845 return l 845 return l
846 846
847 # XXX not in spec 847 # XXX not in spec
848 def filter(self, filterspec, sort, group, num_re = re.compile('^\d+$')): 848 def filter(self, search_matches, filterspec, sort, group,
849 num_re = re.compile('^\d+$')):
849 ''' Return a list of the ids of the active nodes in this class that 850 ''' Return a list of the ids of the active nodes in this class that
850 match the 'filter' spec, sorted by the group spec and then the 851 match the 'filter' spec, sorted by the group spec and then the
851 sort spec 852 sort spec
852 ''' 853 '''
853 cn = self.classname 854 cn = self.classname
932 # straight value comparison for the other types 933 # straight value comparison for the other types
933 break 934 break
934 else: 935 else:
935 l.append((nodeid, node)) 936 l.append((nodeid, node))
936 l.sort() 937 l.sort()
938
939 # filter based on full text search
940 if search_matches is not None:
941 k = []
942 l_debug = []
943 for v in l:
944 l_debug.append(v[0])
945 if search_matches.has_key(v[0]):
946 k.append(v)
947 l = k
937 948
938 # optimise sort 949 # optimise sort
939 m = [] 950 m = []
940 for entry in sort: 951 for entry in sort:
941 if entry[0] != '-': 952 if entry[0] != '-':
1144 cl.create(name=options[i], order=i) 1155 cl.create(name=options[i], order=i)
1145 return hyperdb.Link(name) 1156 return hyperdb.Link(name)
1146 1157
1147 # 1158 #
1148 # $Log: not supported by cvs2svn $ 1159 # $Log: not supported by cvs2svn $
1160 # Revision 1.65 2002/05/22 04:12:05 richard
1161 # . applied patch #558876 ] cgi client customization
1162 # ... with significant additions and modifications ;)
1163 # - extended handling of ML assignedto to all places it's handled
1164 # - added more NotFound info
1165 #
1149 # Revision 1.64 2002/05/15 06:21:21 richard 1166 # Revision 1.64 2002/05/15 06:21:21 richard
1150 # . node caching now works, and gives a small boost in performance 1167 # . node caching now works, and gives a small boost in performance
1151 # 1168 #
1152 # As a part of this, I cleaned up the DEBUG output and implemented TRACE 1169 # As a part of this, I cleaned up the DEBUG output and implemented TRACE
1153 # output (HYPERDBTRACE='file to trace to') with checkpoints at the start of 1170 # output (HYPERDBTRACE='file to trace to') with checkpoints at the start of
1172 # hyperdb.Class (get, set) into the hyperdb.Database. 1189 # hyperdb.Class (get, set) into the hyperdb.Database.
1173 # 1190 #
1174 # Also fixed htmltemplate after the showid changes I made yesterday. 1191 # Also fixed htmltemplate after the showid changes I made yesterday.
1175 # 1192 #
1176 # Unit tests for all of the above written. 1193 # Unit tests for all of the above written.
1194 #
1195 # Revision 1.59.2.2 2002/04/20 13:23:33 rochecompaan
1196 # We now have a separate search page for nodes. Search links for
1197 # different classes can be customized in instance_config similar to
1198 # index links.
1199 #
1200 # Revision 1.59.2.1 2002/04/19 19:54:42 rochecompaan
1201 # cgi_client.py
1202 # removed search link for the time being
1203 # moved rendering of matches to htmltemplate
1204 # hyperdb.py
1205 # filtering of nodes on full text search incorporated in filter method
1206 # roundupdb.py
1207 # added paramater to call of filter method
1208 # roundup_indexer.py
1209 # added search method to RoundupIndexer class
1177 # 1210 #
1178 # Revision 1.59 2002/03/12 22:52:26 richard 1211 # Revision 1.59 2002/03/12 22:52:26 richard
1179 # more pychecker warnings removed 1212 # more pychecker warnings removed
1180 # 1213 #
1181 # Revision 1.58 2002/02/27 03:23:16 richard 1214 # Revision 1.58 2002/02/27 03:23:16 richard

Roundup Issue Tracker: http://roundup-tracker.org/