diff --git a/pure_pagination/paginator.py b/pure_pagination/paginator.py index 567b822..a90d743 100644 --- a/pure_pagination/paginator.py +++ b/pure_pagination/paginator.py @@ -1,4 +1,4 @@ -import collections +from collections.abc import Iterable from django.core.paginator import InvalidPage, EmptyPage, PageNotAnInteger from django.conf import settings @@ -102,7 +102,7 @@ def wrapper(self, *args, **kwargs): if isinstance(result, int): querystring = self._other_page_querystring(result) return PageRepresentation(result, querystring) - elif isinstance(result, collections.Iterable): + elif isinstance(result, Iterable): new_result = [] for number in result: if isinstance(number, int): @@ -129,7 +129,7 @@ def __init__(self, object_list, number, paginator): self.number = PageRepresentation(number, self._other_page_querystring(number)) def __repr__(self): - return '' % (self.number, self.paginator.num_pages) + return f'' def has_next(self): return self.number < self.paginator.num_pages @@ -206,7 +206,7 @@ def _other_page_querystring(self, page_number): return self.base_queryset.urlencode() # raise Warning("You must supply Paginator() with the request object for a proper querystring.") - return 'page=%s' % page_number + return f'page={page_number}' def render(self): return render_to_string('pure_pagination/pagination.html', { diff --git a/setup.py b/setup.py index 3168c9e..b715043 100644 --- a/setup.py +++ b/setup.py @@ -12,10 +12,10 @@ url='https://github.com/jamespacileo/django-pure-pagination/', author='James Pacileo', author_email='jamespacileo@gmail.com', - description='''django-pure-pagination provides advanced pagination features - and is fully compatible with existing code based on Django's - core - pagination module. (aka no need to rewrite code!)''', + description=('django-pure-pagination provides advanced pagination features' + ' and is fully compatible with existing code based on Django\'s' + ' core' + ' pagination module. (aka no need to rewrite code!)'), long_description=README, license='BSD', packages=find_packages(), @@ -39,4 +39,4 @@ 'Topic :: Internet :: WWW/HTTP :: WSGI', 'Topic :: Software Development :: Libraries :: Python Modules', ], -) \ No newline at end of file +)