comparison roundup/backends/back_metakit.py @ 3237:ed97e2a85576 maint-0.8

clearer docs for find(); couple of other post-release fixes
author Richard Jones <richard@users.sourceforge.net>
date Thu, 03 Mar 2005 22:12:36 +0000
parents e1da7b5b04ab
children 985ba73ca6ad
comparison
equal deleted inserted replaced
3234:16f689d45b35 3237:ed97e2a85576
1 # $Id: back_metakit.py,v 1.88.2.3 2005-02-14 02:55:31 richard Exp $ 1 # $Id: back_metakit.py,v 1.88.2.4 2005-03-03 22:12:35 richard Exp $
2 '''Metakit backend for Roundup, originally by Gordon McMillan. 2 '''Metakit backend for Roundup, originally by Gordon McMillan.
3 3
4 Known Current Bugs: 4 Known Current Bugs:
5 5
6 - You can't change a class' key properly. This shouldn't be too hard to fix. 6 - You can't change a class' key properly. This shouldn't be too hard to fix.
1080 view.delete(ndx) 1080 view.delete(ndx)
1081 self.db.destroyjournal(self.classname, id) 1081 self.db.destroyjournal(self.classname, id)
1082 self.db.dirty = 1 1082 self.db.dirty = 1
1083 1083
1084 def find(self, **propspec): 1084 def find(self, **propspec):
1085 '''Get the ids of nodes in this class which link to the given nodes. 1085 '''Get the ids of items in this class which link to the given items.
1086 1086
1087 'propspec' 1087 'propspec' consists of keyword args propname=itemid or
1088 consists of keyword args propname={nodeid:1,} 1088 propname={<itemid 1>:1, <itemid 2>: 1, ...}
1089 'propname' 1089 'propname' must be the name of a property in this class, or a
1090 must be the name of a property in this class, or a 1090 KeyError is raised. That property must be a Link or
1091 KeyError is raised. That property must be a Link or 1091 Multilink property, or a TypeError is raised.
1092 Multilink property, or a TypeError is raised. 1092
1093 1093 Any item in this class whose 'propname' property links to any of
1094 Any node in this class whose propname property links to any of the 1094 the itemids will be returned. Examples::
1095 nodeids will be returned. Used by the full text indexing, which knows 1095
1096 that "foo" occurs in msg1, msg3 and file7; so we have hits on these 1096 db.issue.find(messages='1')
1097 issues::
1098
1099 db.issue.find(messages={'1':1,'3':1}, files={'7':1}) 1097 db.issue.find(messages={'1':1,'3':1}, files={'7':1})
1100 ''' 1098 '''
1101 propspec = propspec.items() 1099 propspec = propspec.items()
1102 for propname, nodeid in propspec: 1100 for propname, nodeid in propspec:
1103 # check the prop is OK 1101 # check the prop is OK

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