Ticket #2878: hit_bugfix.patch
File hit_bugfix.patch, 955 bytes (added by , 18 years ago) |
---|
-
paginator.py
67 67 Returns the 1-based index of the last object on the given page, 68 68 relative to total objects found (hits). 69 69 """ 70 if page_number == 0 and self.num_per_page >= self._hits: 71 return self._hits 72 elif page_number == (self._pages - 1) and (page_number + 1) * self.num_per_page > self._hits: 73 return self._hits 70 # Call this makes sure the paginator asks the database for the 71 # number of hits. 72 hits = self.hits 73 if page_number == 0 and self.num_per_page >= hits: 74 return hits 75 elif page_number == (self._pages - 1) and (page_number + 1) * self.num_per_page > hits: 76 return hits 74 77 return (page_number + 1) * self.num_per_page 75 78 76 79 def _get_hits(self):