Because the assumption is that the QuerySet is going to be evaluated anyway
(it's sort of in the class's name), so performing 2 queries would be
wasteful.

Alex

On Thu, Dec 9, 2010 at 3:50 PM, bastir <bas...@gmail.com> wrote:

> Hey,
> why is the __len__ funtion in ModelChoiceIterator implemented as
> len(self.queryset) and not self.queryset.count.
> I thought the secound case would be a lot faster. Probably i'm
> thinking in the wrong way here.
> thx
> Sebastian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-develop...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com<django-developers%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>


-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you want"
-- Me

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

Reply via email to