keywrod library sorting issue and fitlers inclusion, adn PLAN for refactor of whole page realted

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-18 16:54:07 +00:00
parent 6c69ca3feb
commit 9e88c475f7
4 changed files with 895 additions and 3 deletions

View File

@@ -47,3 +47,19 @@ class CustomPageNumberPagination(PageNumberPagination):
return Response(response_data)
class LargeTablePagination(CustomPageNumberPagination):
"""
Pagination class for large reference tables (e.g., SeedKeywords).
Default page size: 25
Max page size: 500
Important: Server-side sorting/filtering is applied to ALL records first,
then only the requested page is returned. This ensures:
- Sorting by volume returns the 500 highest/lowest volume records globally
- Filters apply to all records, not just the visible page
- Pagination shows accurate total counts
"""
page_size = 25
max_page_size = 500