On Mon, 02 Aug 2010 08:38:37 -0000, Jamu Kakar <email address hidden> wrote:
> Instead of using __nonzero__ we recommend using
> ResultSet.is_empty(). I do wonder if it's worth adding
> __nonzero__... on the one hand it feels like it could be nice
> (obviously people are asking for it), on the other hand it feels
> magical and that it would be better to just use is_empty.
>
> Is there a case where is_empty is not sufficient?
It would be good to have it on SQLObjectResultSet too, so that we can
start migrating code to the explicit check, and they can be robust
against changes in the result set that you get.
Currently if you want to support both you have to use .count(), which
would be bad.
On Mon, 02 Aug 2010 08:38:37 -0000, Jamu Kakar <email address hidden> wrote: is_empty( ). I do wonder if it's worth adding
> Instead of using __nonzero__ we recommend using
> ResultSet.
> __nonzero__... on the one hand it feels like it could be nice
> (obviously people are asking for it), on the other hand it feels
> magical and that it would be better to just use is_empty.
>
> Is there a case where is_empty is not sufficient?
It would be good to have it on SQLObjectResultSet too, so that we can
start migrating code to the explicit check, and they can be robust
against changes in the result set that you get.
Currently if you want to support both you have to use .count(), which
would be bad.
Thanks,
James