summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 468c535)
raw | patch | inline | side by side (parent: 468c535)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 26 Mar 2003 05:28:32 +0000 (05:28 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 26 Mar 2003 05:28:32 +0000 (05:28 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1628 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/back_anydbm.py | patch | blob | history | |
roundup/backends/rdbms_common.py | patch | blob | history |
index b4124439ace17d12eb955e8d4edf3535a4e4a941..278e83cebe6732bbf89133dad04d9902cddc52f4 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.114 2003-03-26 04:56:21 richard Exp $
+#$Id: back_anydbm.py,v 1.115 2003-03-26 05:28:32 richard Exp $
'''
This module defines a backend that saves the hyperdatabase in a database
chosen by anydbm. It is guaranteed to always be available in python
l.append((LINK, k, u))
elif isinstance(propclass, Multilink):
# the value -1 is a special "not set" sentinel
- if v == '-1':
+ if v in ('-1', ['-1]):
v = []
elif type(v) is not type([]):
v = [v]
index c627b629b962c61ec71bebc4ff4aa177acddf3d8..77d02e7a9ca609988acf3c9629e880990b5a6ef5 100644 (file)
-# $Id: rdbms_common.py,v 1.49 2003-03-26 04:56:21 richard Exp $
+# $Id: rdbms_common.py,v 1.50 2003-03-26 05:28:32 richard Exp $
''' Relational database (SQL) backend common code.
Basics:
where = []
args = []
a = self.db.arg
+ print filterspec
for k, v in filterspec.items():
propclass = props[k]
# now do other where clause stuff
if isinstance(propclass, Multilink):
tn = '%s_%s'%(cn, k)
- if isinstance(v, type([])):
+ if v in ('-1', ['-1']):
+ # only match rows that have count(linkid)=0 in the
+ # corresponding multilink table)
+ where.append('id not in (select nodeid from %s)'%tn)
+ elif isinstance(v, type([])):
frum.append(tn)
s = ','.join([a for x in v])
where.append('id=%s.nodeid and %s.linkid in (%s)'%(tn,tn,s))
args = args + v
- elif v == '-1':
- # only match rows that have count(linkid)=0 in the
- # corresponding multilink table)
- where.append('id not in (select nodeid from %s)'%tn)
else:
frum.append(tn)
where.append('id=%s.nodeid and %s.linkid=%s'%(tn, tn, a))
print >>hyperdb.DEBUG, 'filter', (self, sql, args)
self.db.cursor.execute(sql, args)
l = self.db.cursor.fetchall()
+ print sql, l
# return the IDs (the first column)
# XXX The filter(None, l) bit is sqlite-specific... if there's _NO_