summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 19d9409)
raw | patch | inline | side by side (parent: 19d9409)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 24 Sep 2002 07:39:52 +0000 (07:39 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 24 Sep 2002 07:39:52 +0000 (07:39 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1227 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/backends/rdbms_common.py | patch | blob | history |
index b0eb498b0c0df99ae5fdefe13c49f18edca702d2..e9bef54988dcf671e25a4ca8d6e3b7448027c771 100644 (file)
-# $Id: rdbms_common.py,v 1.15 2002-09-24 01:59:28 richard Exp $
+# $Id: rdbms_common.py,v 1.16 2002-09-24 07:39:52 richard Exp $
# standard python modules
import sys, os, time, re, errno, weakref, copy
if not self.key:
raise TypeError, 'No key property set for class %s'%self.classname
- sql = 'select id,__retired__ from _%s where _%s=%s'%(self.classname,
- self.key, self.db.arg)
+ sql = '''select id from _%s where _%s=%s
+ and __retired__ != '1' '''%(self.classname, self.key,
+ self.db.arg)
self.db.sql(sql, (keyvalue,))
# see if there was a result that's not retired
- l = self.db.cursor.fetchall()
- if not l or int(l[0][1]):
+ row = self.db.sql_fetchone()
+ if not row:
raise KeyError, 'No key (%s) value "%s" for "%s"'%(self.key,
keyvalue, self.classname)
# return the id
- return l[0][0]
+ return row[0]
def find(self, **propspec):
'''Get the ids of nodes in this class which link to the given nodes.