mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
Update pagination.py
simplified divided_with_ceill function
This commit is contained in:
parent
04e0c2b9ab
commit
78741b15f5
|
@ -35,10 +35,7 @@ def _divide_with_ceil(a, b):
|
|||
"""
|
||||
Returns 'a' divided by 'b', with any remainder rounded up.
|
||||
"""
|
||||
if a % b:
|
||||
return (a // b) + 1
|
||||
|
||||
return a // b
|
||||
return (a + b - 1) // b
|
||||
|
||||
|
||||
def _get_displayed_page_numbers(current, final):
|
||||
|
|
Loading…
Reference in New Issue
Block a user