mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Merged regressiontests and modeltests into the test root.
This commit is contained in:
parent
b3d2ccb5bf
commit
89f40e3624
1050 changed files with 0 additions and 0 deletions
20
tests/pagination/custom.py
Normal file
20
tests/pagination/custom.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from django.core.paginator import Paginator, Page
|
||||
|
||||
|
||||
class ValidAdjacentNumsPage(Page):
|
||||
|
||||
def next_page_number(self):
|
||||
if not self.has_next():
|
||||
return None
|
||||
return super(ValidAdjacentNumsPage, self).next_page_number()
|
||||
|
||||
def previous_page_number(self):
|
||||
if not self.has_previous():
|
||||
return None
|
||||
return super(ValidAdjacentNumsPage, self).previous_page_number()
|
||||
|
||||
|
||||
class ValidAdjacentNumsPaginator(Paginator):
|
||||
|
||||
def _get_page(self, *args, **kwargs):
|
||||
return ValidAdjacentNumsPage(*args, **kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue