1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Moved PAGINATE_COUNT to configuration.py

This commit is contained in:
Jeremy Stretch
2016-05-23 12:55:03 -04:00
parent 81fd1dfde4
commit c96bfdbc18
5 changed files with 45 additions and 28 deletions

View File

@@ -1,8 +1,13 @@
from django.conf import settings
from django.core.paginator import Paginator, Page
class EnhancedPaginator(Paginator):
def __init__(self, object_list, per_page, **kwargs):
per_page = getattr(settings, 'PAGINATE_COUNT', 50)
super(EnhancedPaginator, self).__init__(object_list, per_page, **kwargs)
def _get_page(self, *args, **kwargs):
return EnhancedPage(*args, **kwargs)