Sorry, I wasn't clear. If I call 'len' (line 5), the number of records returned by "paged_notes.paginator.count" process is correct. If I don't call len, the number returned is off.
On Mon, Jun 14, 2010 at 9:17 PM, Harley Bussell <mod...@gmail.com> wrote: > > count() does a sql count statement, while len() loads all rows from > the database and returns the array length of the results. > count() is much faster and better to use if you can conditionally > avoid loading all results. > > On Jun 15, 6:17 am, Lee Hinde <leehi...@gmail.com> wrote: > > This started off as a pagination question, but then I realized it was > > a different issue: > > > > Given:http://dpaste.com/hold/207217/ > > > > why would len(n) be different than n.count() > > > > In my case, the len result is correct, but Paginator tries count first > > (and uses that value). > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.