Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(generic): allow to disable pagination in table class #1454

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

b1rger
Copy link
Contributor

@b1rger b1rger commented Nov 27, 2024

Instead of overriding the get_paginate_by method of the
TableMixinBase, we now override the get_table_pagination method. This
allows to also set the table_pagination setting in the table
itself, therefore providing the means to disable the pagination
alltogether.

Closes: #1444

Instead of overriding the `get_paginate_by` method of the
TableMixinBase, we now override the `get_table_pagination` method. This
allows to also set the `table_pagination` setting in the table
itself, therefore providing the means to disable the pagination
alltogether.

Closes: #1444
@b1rger b1rger force-pushed the birger/1444-table-pagination branch from 05f9ebf to bd90a77 Compare November 27, 2024 08:22
@b1rger b1rger changed the title feat(generic): allow to disabel pagination in table class feat(generic): allow to disable pagination in table class Nov 27, 2024
@b1rger b1rger marked this pull request as ready for review November 27, 2024 08:37
@b1rger b1rger requested a review from gythaogg November 27, 2024 08:37
Copy link
Contributor

@gythaogg gythaogg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. paginate_by = None or not set at all - page size is 25
  2. paginate_by = 10 - page size is 10
  3. table_pagination = None or not set at all - page size is 25 or the value of paginate_by
  4. table_pagination = False - pagination is disabled
  5. table_pagination = True throws 'bool' object is not iterable error

Code change is approved but the PR should also go with the following change in documentation I think

Your table can also contain a paginate_by attribute, which is then used by the list view to determines the number of items per page, or None for no pagination (which is the default).

should be modified to something like

Your table can also contain a paginate_by attribute, which is then used by the list view to determine the number of items per page. When this is not set, the page size defaults to 25. To disable pagination altogether, use table_pagination = False.

@b1rger b1rger requested a review from gythaogg November 27, 2024 10:59
@b1rger b1rger merged commit 9e35eb7 into main Nov 27, 2024
14 checks passed
@b1rger b1rger deleted the birger/1444-table-pagination branch November 27, 2024 12:26
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.

bug: pagination size
2 participants