.count uses a sql function that just counts the rows. Doing len(model.objects.all()) pulls ALL of the objects from the database including all of the associated data and then counts them.
It should be a significant performance difference for any large data set. On Sep 24, 11:12 am, Chris Withers <ch...@simplistix.co.uk> wrote: > 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? > > 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 -~----------~----~----~----~------~----~------~--~---