QuerySet.exists() and __nonzero__

6 views
Skip to first unread message

Jiri Barton

unread,
Nov 2, 2009, 4:35:57 AM11/2/09
to Django developers
Hello everyone,

I listened to the Django Dose this morning and to my great delight,
found QuerySet.exists() has landed in the trunk. I did not however
hear anything about yes or no on using __nonzero__ on the interface
side. Having read this thread

http://groups.google.com/group/django-developers/browse_thread/thread/5490f8736cc54c27/a7bd7dcb9921fc80

one would think it has been settled the two methods would either
coexist or one of them would go. Well, it seems QuerySet.__nonzero__
still uses an old implementation from 7477 with an iterator as of
today. I was wondering if a consensus has been reached and __nonzero__
could use the new QuerySet.exists()?

Thank you

Jacob Kaplan-Moss

unread,
Nov 2, 2009, 8:22:54 AM11/2/09
to django-d...@googlegroups.com
On Mon, Nov 2, 2009 at 4:35 AM, Jiri Barton <whis...@gmail.com> wrote:
> I was wondering if a consensus has been reached and __nonzero__
> could use the new QuerySet.exists()?

This was discussed, and Luke explains why __nonzero__ can't do this
optimization here:
http://code.djangoproject.com/ticket/11402#comment:5.

Jacob

Reply all
Reply to author
Forward
0 new messages