[orm-devel] Issue, current CVS
Mike Watkins
orm-devel@mailman.tux4web.de
Fri, 22 Nov 2002 23:16:21 -0800
Consider the following:
ds = get_datasource()
p = ds.select(Person, user_name='admin').fetchone()
No problem
p = ds.select(Person, user_name='adminnamedoesntexist').fetchone()
Rather than returning None, EmptyResultError is being raised. Is this new
behaviour? Noted also in 07pre2 as well. I'm assuming the intent is rather
to return None to the caller.
Mike
---------------------------
Traceback (most recent call last):
File "db.py", line 41, in ?
p = ds.select(Person, user_name='adminnamedoesntexist').fetchone()
File "C:\Python22\lib\site-packages\orm\datasource.py", line 186, in
fetchone
queryResult.fetchone(self))
File "C:\Python22\lib\site-packages\orm\dbclass.py", line 119, in _fromTuple
if tpl == None: raise EmptyResultError()
EmptyResultError