summaryrefslogtreecommitdiff
path: root/django/core/paginator.py
AgeCommit message (Collapse)Author
2026-02-27Refs #23919 -- Used yield from in Paginator.Pierre Sassoulas
2026-01-31Refs #34118 -- Removed asgiref coroutine detection shims.Jacob Walls
As Python 3.12 is now the floor, we can drop the shims and use the `inspect` module.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-09Refs #35844, #35945 -- Used asgiref.sync.iscoroutinefunction() instead of ↵Mariusz Felisiak
deprecated asyncio.iscoroutinefunction(). Follow up to bd3b1dfa2422e02ced3a894adb7544e42540c97d. Introduced in 2ae3044d9d4dfb8371055513e440e0384f211963. Fixes DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead.
2025-03-25Fixed #35452 -- Deprecated orphans being more than or equal to page_size in ↵wookkl
pagination.
2025-03-12Fixed #35945 -- Added async interface to Paginator.wookkl
2023-04-12Fixed #27505 -- Allowed customizing Paginator's error messages.Marcelo Galigniana
2022-10-13Removed unused branch in Paginator.validate_number().Marcelo Galigniana
Unused since 96cf3656c48f6c42714a70b4546bc42f7b904185.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-08-06Fixed #25513 -- Extracted admin pagination to Paginator.get_elided_page_range().Nick Pope
2019-10-02Fixed #14218 -- Added Paginator.__iter__().Tanner Stirrat
2019-09-10Refs #29703 -- Removed QuerySetPaginator alias per deprecation timeline.Mariusz Felisiak
2019-07-23Improved error message when index in __getitem__() is invalid.Jon Dufresne
2018-08-27Fixed #29703 -- Deprecated QuerySetPaginator alias.Nick Pope
Unused since 4406d283e13819b04556df21044089b7d119edb0.
2018-08-07Fixed #29244 -- Prevented Paginator.count() from silencing TypeError and ↵Josh Schneier
AttributeError.
2018-05-09Fixed #29389 -- Made Paginator reject non-integer page numbers of type float.Nicolas Noé
2018-02-05Refs #28814 -- Imported from collections.abc to fix Python 3.7 deprecation ↵Raymond Hettinger
warnings. https://bugs.python.org/issue25988
2017-10-02Refs #23919 -- Removed unneeded float()/int() calls.Mariusz Felisiak
2017-09-06Fixed #28032 -- Added Paginator.get_page().Sami J. Lehtinen
Moved boilerplate from docs to a method.
2017-06-13Fixed #28284 -- Prevented Paginator's unordered object list warning from ↵orf
evaluating a QuerySet.
2017-04-22Fixed #28109 -- Corrected the stack level of unordered queryset pagination ↵Simon Charette
warnings. Refs #26290. Thanks Tim for the review.
2017-02-21Refs #27656 -- Updated django.core docstring verbs according to PEP 257.Anton Samarchyan
2017-02-07Converted usage of ugettext* functions to their gettext* aliasesClaude Paroz
Thanks Tim Graham for the review.
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2016-12-01Refs #27505 -- Made Paginator's exception messsages translatable.Anton Bazhanov
2016-06-08Fixed #26290 -- Warned that paginating an unordered QuerySet may result in ↵Emad Mokhtar
inconsistent results.
2016-04-15Converted property syntax in django.core.paginatorClaude Paroz
2015-07-03Fixed #23190 -- Made Paginator.page_range an iteratorRigel Di Scala
2014-08-03Ensured that Paginator.page_range works the same on Python 2 and 3.Florian Apolloner
This somewhat fixes #23088, refs 23140.
2014-08-03Revert "Fixed #23088 -- Used `six` `range` type in `Paginator.page_range`."Florian Apolloner
This reverts commit 6508db2ff9fc5be95fec903b3fa7ab8204fe316a. Refs #23088.
2014-07-25Fixed #23088 -- Used `six` `range` type in `Paginator.page_range`.Moayad Mardini
2013-05-25Fixed #19938 -- Consumed iterator only once in paginator's PageAndrew Jesaitis
Thanks Joshua Fialkoff for the report.
2012-11-21Paginator._get_page hookChris Beaven
This allows for Paginator subclasses to easily override the Page class that gets used. Took the opportunity to also do some non-invasive PEP8 tidying of the paginator module.
2012-11-09Fixed #19261 -- Delayed Queryset evaluation in paginatorsClaude Paroz
Thanks trbs for the report and the patch.
2012-11-08Made Page class inherit collections.SequenceClaude Paroz
2012-06-09Fixed #17159 -- Validated returned number of next|previous_page_numberClaude Paroz
Thanks mehta.apurva at gmail.com for the report and the initial patch and neaf for the complete patch.
2011-05-20Remove an unused import from django.core.paginatorChris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16247 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22Fixed #13689 -- Convert the per_page value to an integer upon initialization ↵Jannis Leidel
of the Paginator class to prevent unpleasant TypeErrors. Thanks, rbanffy, Eric Florenzano and Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-13Fixes Paginator.validate_number not raising a PageNotAnInteger exception ↵Chris Beaven
when passed a non-int-castable type. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16026 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-06Fixes #11596 -- Make paginator.Page iterableChris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02Removed several deprecated features for 1.0 (refs #7830):Gary Wilson Jr
* "simple" cache backend * `ObjectPaginator` * `edit_inline_type` argument for `ForeignKey` fields * `QOperator`, `QNot`, `QAnd` and `QOr` * `maxlength` argument git-svn-id: http://code.djangoproject.com/svn/django/trunk@8191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28Fixed #6997 -- Corrected `num_pages` calculation when one item is in the ↵Gary Wilson Jr
object list and `allow_empty_first_page=False`, thanks to framos for the report. Also, made Page's `start_index()` return 0 if there are no items in the object list (previously it was returning 1, but now it is consistent with `end_index()`). As an added bonus, I threw in quite a few pagination tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27Made the Paginator class a bit more backwards compatible with the lecacy ↵Gary Wilson Jr
`ObjectPaginator` class by using the `ObjectPaginator`'s `_get_count` method. Instead of explicitly checking for an instance of `QuerySet`, this now allows any object with a `count()` or `__len__()` method defined to be passed to Paginator. For one, this is useful when you have custom `QuerySet`-like classes that implement a `count()` method but don't inherit from `QuerySet` explicitly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08Fixed #7307 -- Split InvalidPage exception into two subclasses, ↵Adrian Holovaty
PageNotAnInteger and EmptyPage, for granular exception catching. Thanks for the idea, miracle2k git-svn-id: http://code.djangoproject.com/svn/django/trunk@7867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08Fixed #7478 -- Rolled QuerySetPaginator into the Paginator class, to ↵Adrian Holovaty
simplify things. QuerySetPaginator still exists as an alias, for backwards compatibility. Thanks for the suggestion, batiste@dosimple.ch git-svn-id: http://code.djangoproject.com/svn/django/trunk@7865 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02Made legacy `ObjectPaginator` truly backwards-compatible by catching both ↵Gary Wilson Jr
`AttributeError` and `TypeError` in `_get_count` as it did before [7306]. Tests included. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-23Fixed a problem in the backwards-compat abilities of the paginator. Calling ↵Malcolm Tredinnick
count() on a list throws a TypeError not an AttributeError. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18Added a new and improved Paginator class, which allows you to pass a Page ↵Adrian Holovaty
object to the template instead of 5 or 6 separate variables. ObjectPaginator still exists for backwards compatibility but issues a DeprecationWarning git-svn-id: http://code.djangoproject.com/svn/django/trunk@7306 bcc190cf-cafb-0310-a4f2-bffc1f526a37