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:
parent
0fea1348d6
commit
99150048ac
|
@ -173,7 +173,7 @@ class ObjectPaginator(Paginator):
|
||||||
if self._count is None:
|
if self._count is None:
|
||||||
try:
|
try:
|
||||||
self._count = self.object_list.count()
|
self._count = self.object_list.count()
|
||||||
except AttributeError:
|
except TypeError:
|
||||||
self._count = len(self.object_list)
|
self._count = len(self.object_list)
|
||||||
return self._count
|
return self._count
|
||||||
count = property(_get_count)
|
count = property(_get_count)
|
||||||
|
|
Loading…
Reference in New Issue