-
Notifications
You must be signed in to change notification settings - Fork 64
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 as expected #123
Comments
I would add an appropriate default ordering to the Model to make sure that when issuing a second query to populate the second page, the underlying queryset is extracted in a stable manner |
Thanks for the recommendation. I will give it a try. However, the thing is that when sorted by site_name (the default sort field in DataTables) there are no issues. If I sort by dr, or cf (numerical values) some of the records that are displayed towards the end of page N are also displayed among the first records of page N+1. One thing I noticed is that the records that are repeated, seem to all have the same value, in the sorted field. Going back to the screenshots above, both steemit.com and anchoratemes.com (the two records that are duplicated on the second page) are part of the subset of records that have dr=84. I will go on a limb to presume that this might have something to do with the reason why the values are duplicated, even though I can't say for sure. Do you think that providing a default ordering to the Django model will help? On another train of thought, in light of the new information provided, maybe something else comes to mind, some other way to investigate/fix this? |
I recently had a similar problem in a completely different context, and I do believe it is an SQL-related issue. |
Hey. I also tried declaring default ordering model-wise but to no avail. It behaves the same. I did, however, notice that the sub-group of fields that have the DR value 84, are not sorted by any other criteria than DR. Is there any possibility to customize sorting and also add other sorting criteria? Do you happen to have any other recommendations? Thank you |
I have a Django application that is integrated with a Postgres database. In the front-end I use DataTables and, Python-side, I use django-ajax-datatable.
I am facing an issue that I don't really know how to tackle namely, when the table is sorted on certain columns, some records that appear towards the end of the current page, will also be present in the second page.
Ex:
I will provide the code for the aforementioned table:
The Python class:
JS Code in template:
The Django model:
I am using:
Please give me a hand in investigating this issue. I want to determine if it's a bug or now and how to fix it.
Thank you in advance.
The text was updated successfully, but these errors were encountered: