Opened 18 years ago
Closed 18 years ago
#7192 closed (wontfix)
class Paginator::def _get_count(self):
| Reported by: | kamanwu | Owned by: | nobody |
|---|---|---|---|
| Component: | Tools | Version: | dev |
| Severity: | Keywords: | Paginator | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
change:
self._count = len(self.object_list)
to:
try:
self._count = int(self.object_list.count())
except (AttributeError, TypeError, ValueError):
self._count = len(self.object_list)
Note:
See TracTickets
for help on using tickets.
There is a separate QuerySetPageinator class that implements using the count method.