comparison roundup/backends/rdbms_common.py @ 1557:b8fcf2763033

sigh
author Richard Jones <richard@users.sourceforge.net>
date Wed, 26 Mar 2003 05:29:06 +0000
parents 9e89f5394f6c
children e2a8ce4d2317
comparison
equal deleted inserted replaced
1556:9e89f5394f6c 1557:b8fcf2763033
1 # $Id: rdbms_common.py,v 1.50 2003-03-26 05:28:32 richard Exp $ 1 # $Id: rdbms_common.py,v 1.51 2003-03-26 05:29:06 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
1779 props = self.getprops() 1779 props = self.getprops()
1780 frum = ['_'+cn] 1780 frum = ['_'+cn]
1781 where = [] 1781 where = []
1782 args = [] 1782 args = []
1783 a = self.db.arg 1783 a = self.db.arg
1784 print filterspec
1785 for k, v in filterspec.items(): 1784 for k, v in filterspec.items():
1786 propclass = props[k] 1785 propclass = props[k]
1787 # now do other where clause stuff 1786 # now do other where clause stuff
1788 if isinstance(propclass, Multilink): 1787 if isinstance(propclass, Multilink):
1789 tn = '%s_%s'%(cn, k) 1788 tn = '%s_%s'%(cn, k)
1929 args = tuple(args) 1928 args = tuple(args)
1930 if __debug__: 1929 if __debug__:
1931 print >>hyperdb.DEBUG, 'filter', (self, sql, args) 1930 print >>hyperdb.DEBUG, 'filter', (self, sql, args)
1932 self.db.cursor.execute(sql, args) 1931 self.db.cursor.execute(sql, args)
1933 l = self.db.cursor.fetchall() 1932 l = self.db.cursor.fetchall()
1934 print sql, l
1935 1933
1936 # return the IDs (the first column) 1934 # return the IDs (the first column)
1937 # XXX The filter(None, l) bit is sqlite-specific... if there's _NO_ 1935 # XXX The filter(None, l) bit is sqlite-specific... if there's _NO_
1938 # XXX matches to a fetch, it returns NULL instead of nothing!?! 1936 # XXX matches to a fetch, it returns NULL instead of nothing!?!
1939 return filter(None, [row[0] for row in l]) 1937 return filter(None, [row[0] for row in l])

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