1. Mike Bayer
  2. sqlalchemy

Issues

Issue #124 resolved

selectone broken >= r1181

Anonymous created an issue

selectone on a mapper does not work anymore at least since r1181

demo programm:

from sqlalchemy import *
engine = create_engine('oracle://dsn=orcl&user=test&password=test')

foo = Table('foo', engine, Column('id', Integer, Sequence('foo_seq'), primary_key=True))
class Foo(object): pass
foos = mapper(Foo, foo)
try: foo.drop()
except: pass
try: foo.create()
except: pass

foos.selectone() #this gives the exception below

exception

File "selectone.py", line 13, in ?
  foos.selectone()
File "/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-py2.4.egg/sqlalchemy/mapping/mapper.py", line 496, in selectone
  raise InvalidRequestError('Multiple rows returned for selectone')
sqlalchemy.exceptions.InvalidRequestError: Multiple rows returned for selectone

Comments (3)

  1. Anonymous

    This issue stems from a change in semantics of selectone, and selectfirst takes now this role. (as in it's probably resolved)

  2. Log in to comment