On 27/09/2007, Gustavo Niemeyer <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> > How do I quickly test if there are results in the resultset?
>
> You can use bool(result.count()) or bool(result.any()).
It is also worth noting that in many cases it is cheaper to perform
one query than two, so the "check if the row exists, then retrieve it"
methodology is often slower.
Why not just request the row directly?
user = store.find(User, User.username == u"Akira").one()
if user is not None:
...
James.
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm