Skip to content

Conversation

@federicobond
Copy link
Contributor

This is a Proof-of-Concept for replacing the custom querystring_replace templatetag with the built-in Django querystring.

Most of the changes are in a new TablePaginatorMixin which brings table-awareness to the default Paginator and LazyPaginator, mainly so that its methods can access the prefixed_page_field value.

Since most of the necessary data is now in the paginator, it made sense to try moving table_page_range there (a different question is if we should leave the existing templatetag filter for compatibility).

To correctly access the query params for each page, paginator.table_page_range now returns a list of PageNumber instances. I recognize that the PageNumber implementation is a bit hacky, which kept the template changes minimal, but we can always revise it to return a list of PageInfo dataclasses or something else as an alternative.

Tests are not passing currently because I wanted to validate some of the ideas first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant