I'm sorry I don't quite get it. There's two different issues at hand. #1 No result of selectone was forthcomming. things todo: either return None or Raise an exception (a more sensible one please), consensus over what to do will have to ensue. My vote on this goes with None as it can-be quite an expected result not to get something from selectone, wheras I see exceptions more of a way to signify problems that indicate contractial missbehavior.
#2 How can selectone return more then one? I mean, selectone *is* the contract... Quoting Robert Leftwich <[EMAIL PROTECTED]>: > Florian Boesch wrote: > > selectone of a mapper does not work anymore. > > > > I think you'll find it is still working, it is just throwing an exception > when 0 > *or* > 1 rows are returned, i.e. add one f = Foo() and an > objectstore.commit() > and the exception goes away, add a second g = Foo() and the exception is > thrown > again as more than 1 row has been returned. > > When I saw this over the weekend my first reaction was to think it was a > problem, but the function is called selectone and the new behaviour does meet > that contract, i.e give me one and only one row. However, there is now no way > to > tell if the error was thrown because there were no rows or more than one row, > which is often a useful piece of information :-). > > So, what do people think- should the current behaviour remain or should it be > changed? If the latter should it revert to the original behaviour, return > None > when no rows are returned and throw the exception if > 1 are returned or > something else? > > Robert > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users > > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Sqlalchemy-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

