Jani Tiainen wrote:
> Chris Withers kirjoitti:
>> Brian McKeever wrote:
>>> .count is definitely the way to go. Although, I would probably pass it
>>> to your template instead of determining it there.
>> What difference does it make?
> 
> len(qs) evaluates queryset - thus pulling in _every_ object from DB to 
> Python - which you might not want specially if queryset is large.
> 
> .count() executes count query on DB side returing only single scalar 
> value to Python.
> 
> Figure out which one is faster...

Er, I was asking what the difference was between calling .count in the 
view and in the template. I can't think why it would make a difference, 
but Brian suggested it did...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

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

Reply via email to