On Jan 14, 2008, at 11:23 AM, Adrian wrote:

>
> I am a bit confused by the behavior for the methods all() and one() if
> the Query would return an empty result set. In the case of all() it
> returns an empty list whereas one() will throw an exception
> (sqlalchemy.exceptions.InvalidRequestError). I am sure there was a
> reason to implement as it is now but wouldn't it be more convenient to
> return simply None (or an empty String) and throw an exception only if
> more than one row would be returned? An empty result set as such is
> valid and shouldn't be treated as an error.

use query.first() instead of query.one().

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to