selectone broken >= r1181

Issue #124 resolved
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


File "", line 13, in ?
File "/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.1.4-py2.4.egg/sqlalchemy/mapping/", 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