comparison roundup/backends/back_anydbm.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 311cdc126ff3
children 6d6d7e331c54
comparison
equal deleted inserted replaced
3234:16f689d45b35 3237:ed97e2a85576
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.179.2.6 2005-02-14 05:40:54 richard Exp $ 18 #$Id: back_anydbm.py,v 1.179.2.7 2005-03-03 22:12:35 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 '''
1429 # change from spec - allows multiple props to match 1429 # change from spec - allows multiple props to match
1430 def find(self, **propspec): 1430 def find(self, **propspec):
1431 '''Get the ids of items in this class which link to the given items. 1431 '''Get the ids of items in this class which link to the given items.
1432 1432
1433 'propspec' consists of keyword args propname=itemid or 1433 'propspec' consists of keyword args propname=itemid or
1434 propname={itemid:1, } 1434 propname={<itemid 1>:1, <itemid 2>: 1, ...}
1435 'propname' must be the name of a property in this class, or a 1435 'propname' must be the name of a property in this class, or a
1436 KeyError is raised. That property must be a Link or 1436 KeyError is raised. That property must be a Link or
1437 Multilink property, or a TypeError is raised. 1437 Multilink property, or a TypeError is raised.
1438 1438
1439 Any item in this class whose 'propname' property links to any of the 1439 Any item in this class whose 'propname' property links to any of
1440 itemids will be returned. Used by the full text indexing, which knows 1440 the itemids will be returned. Examples::
1441 that "foo" occurs in msg1, msg3 and file7, so we have hits on these 1441
1442 issues: 1442 db.issue.find(messages='1')
1443
1444 db.issue.find(messages={'1':1,'3':1}, files={'7':1}) 1443 db.issue.find(messages={'1':1,'3':1}, files={'7':1})
1445 ''' 1444 '''
1446 propspec = propspec.items() 1445 propspec = propspec.items()
1447 for propname, itemids in propspec: 1446 for propname, itemids in propspec:
1448 # check the prop is OK 1447 # check the prop is OK

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