From 99150048ac1158e3978c2854bdb07bd4f2fce9fe Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 23 Mar 2008 10:14:32 +0000 Subject: [PATCH] Fixed a problem in the backwards-compat abilities of the paginator. Calling count() on a list throws a TypeError not an AttributeError. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7353 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/paginator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/paginator.py b/django/core/paginator.py index dabd20dfc0..04cc4bf481 100644 --- a/django/core/paginator.py +++ b/django/core/paginator.py @@ -173,7 +173,7 @@ class ObjectPaginator(Paginator): if self._count is None: try: self._count = self.object_list.count() - except AttributeError: + except TypeError: self._count = len(self.object_list) return self._count count = property(_get_count)