Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 1912:2b0ab61db194
fixes for [SF#818339]
fixes for metakit for the new db unit tests
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 12 Nov 2003 03:42:13 +0000 |
| parents | f5c804379c85 |
| children | f9316d2cd5ba |
comparison
equal
deleted
inserted
replaced
| 1911:f5c804379c85 | 1912:2b0ab61db194 |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.68 2003-11-12 01:00:58 richard Exp $ | 1 # $Id: rdbms_common.py,v 1.69 2003-11-12 03:42:12 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 |
| 1781 '''Get the ids of nodes in this class which link to the given nodes. | 1781 '''Get the ids of nodes in this class which link to the given nodes. |
| 1782 | 1782 |
| 1783 'propspec' consists of keyword args propname=nodeid or | 1783 'propspec' consists of keyword args propname=nodeid or |
| 1784 propname={nodeid:1, } | 1784 propname={nodeid:1, } |
| 1785 'propname' must be the name of a property in this class, or a | 1785 'propname' must be the name of a property in this class, or a |
| 1786 KeyError is raised. That property must be a Link or Multilink | 1786 KeyError is raised. That property must be a Link or |
| 1787 property, or a TypeError is raised. | 1787 Multilink property, or a TypeError is raised. |
| 1788 | 1788 |
| 1789 Any node in this class whose 'propname' property links to any of the | 1789 Any node in this class whose 'propname' property links to any of the |
| 1790 nodeids will be returned. Used by the full text indexing, which knows | 1790 nodeids will be returned. Used by the full text indexing, which knows |
| 1791 that "foo" occurs in msg1, msg3 and file7, so we have hits on these | 1791 that "foo" occurs in msg1, msg3 and file7, so we have hits on these |
| 1792 issues: | 1792 issues: |
| 1814 allvalues = () | 1814 allvalues = () |
| 1815 a = self.db.arg | 1815 a = self.db.arg |
| 1816 for prop, values in propspec: | 1816 for prop, values in propspec: |
| 1817 if not isinstance(props[prop], hyperdb.Link): | 1817 if not isinstance(props[prop], hyperdb.Link): |
| 1818 continue | 1818 continue |
| 1819 if type(values) is type({}) and len(values) == 1: | |
| 1820 values = values.keys()[0] | |
| 1819 if type(values) is type(''): | 1821 if type(values) is type(''): |
| 1820 allvalues += (values,) | 1822 allvalues += (values,) |
| 1821 where.append('_%s = %s'%(prop, a)) | 1823 where.append('_%s = %s'%(prop, a)) |
| 1822 elif values is None: | 1824 elif values is None: |
| 1823 where.append('_%s is NULL'%prop) | 1825 where.append('_%s is NULL'%prop) |
