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
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to