QuerySet.exists() and __nonzero__

View: New views
2 Messages — Rating Filter:   Alert me  

QuerySet.exists() and __nonzero__

by Jiri Barton-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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


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


Re: QuerySet.exists() and __nonzero__

by Jacob Kaplan-Moss-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, Nov 2, 2009 at 4:35 AM, Jiri Barton <whiskybar@...> 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

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