-
Notifications
You must be signed in to change notification settings - Fork 428
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
pagination not working with SingleTableMixin #354
pagination not working with SingleTableMixin #354
Comments
Hi @fkdeboer, thanks for reporting. To clarify: are you reporting it doesn't work, or that it doesn't work by default? |
Hi Jieter, def get_table_pagination(self, table):
"""
Returns pagination options: True for standard pagination (default),
False for no pagination, and a dictionary for custom pagination.
"""
return self.table_pagination |
It does not work even if |
I think I have found the bug (regression). RequestConfig.paginate defaults to True, which enabled calling Table.paginate with per_page=None, which in turn uses TableOptions.per_page which defaults to 25. Now, with the rewrite of the Mixins, RequestConfig always gets passed While in the old code, it would pass |
The change in default behavior (from paginating by default to no pagination by default) should probably be documented in the changelog. |
But is this desirable behavior? under the new default we encountered a gateway timeout due to tables2 trying gettings thousands of records from the DB one by one. |
@fkdeboer We caught the bug prior to updating our production environment but the same would have occurred in our case too had we not done so. According to SEMVER this kind of change should warrant a major version bump (certainly not a patch version bump). |
Sorry guys, this is certainly not intended, and should be reverted. Furthermore, these kinds of behaviours should be covered by tests. @graup, seems like you dove in, are you probably willing to make a pull request? |
@jieter yes, I can do it in a few days. I would add a regression test confirming the default and then fix the code that I mentioned, ok? |
@graup, thanks, looking forward to it. |
Fixes #354 - Restore default pagination for SingleTableMixin
Hi,
in v1.2.3 my tables aren't paginated anymore with the SingleTableMixin.
A default like table_pagination = 20 should be added.
The text was updated successfully, but these errors were encountered: