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
This commit is contained in:
Malcolm Tredinnick 2008-03-23 10:14:32 +00:00
parent 0fea1348d6
commit 99150048ac
1 changed files with 1 additions and 1 deletions

View File

@ -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)