Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.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 | 5bd7a4caba0d |
| children | 088c1792b7f6 |
comparison
equal
deleted
inserted
replaced
| 3234:16f689d45b35 | 3237:ed97e2a85576 |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.142.2.6 2005-03-02 14:09:30 a1s Exp $ | 1 # $Id: rdbms_common.py,v 1.142.2.7 2005-03-03 22:12:36 richard Exp $ |
| 2 ''' Relational database (SQL) backend common code. | 2 ''' Relational database (SQL) backend common code. |
| 3 | 3 |
| 4 Basics: | 4 Basics: |
| 5 | 5 |
| 6 - map roundup classes to relational tables | 6 - map roundup classes to relational tables |
| 1883 # return the id | 1883 # return the id |
| 1884 # XXX numeric ids | 1884 # XXX numeric ids |
| 1885 return str(row[0]) | 1885 return str(row[0]) |
| 1886 | 1886 |
| 1887 def find(self, **propspec): | 1887 def find(self, **propspec): |
| 1888 '''Get the ids of nodes in this class which link to the given nodes. | 1888 '''Get the ids of items in this class which link to the given items. |
| 1889 | 1889 |
| 1890 'propspec' consists of keyword args propname=nodeid or | 1890 'propspec' consists of keyword args propname=itemid or |
| 1891 propname={nodeid:1, } | 1891 propname={<itemid 1>:1, <itemid 2>: 1, ...} |
| 1892 'propname' must be the name of a property in this class, or a | 1892 'propname' must be the name of a property in this class, or a |
| 1893 KeyError is raised. That property must be a Link or | 1893 KeyError is raised. That property must be a Link or |
| 1894 Multilink property, or a TypeError is raised. | 1894 Multilink property, or a TypeError is raised. |
| 1895 | 1895 |
| 1896 Any node in this class whose 'propname' property links to any of the | 1896 Any item in this class whose 'propname' property links to any of |
| 1897 nodeids will be returned. Used by the full text indexing, which knows | 1897 the itemids will be returned. Examples:: |
| 1898 that "foo" occurs in msg1, msg3 and file7, so we have hits on these | 1898 |
| 1899 issues: | 1899 db.issue.find(messages='1') |
| 1900 | |
| 1901 db.issue.find(messages={'1':1,'3':1}, files={'7':1}) | 1900 db.issue.find(messages={'1':1,'3':1}, files={'7':1}) |
| 1902 ''' | 1901 ''' |
| 1903 # shortcut | 1902 # shortcut |
| 1904 if not propspec: | 1903 if not propspec: |
| 1905 return [] | 1904 return [] |
