[PR #9716] [MERGED] Closes #9599: Add cursor pagination mode #13508

Closed
opened 2025-12-29 23:19:16 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/9716
Author: @lyuyangh
Created: 7/13/2022
Status: Merged
Merged: 10/26/2022
Merged by: @jeremystretch

Base: 9599-cursor-paginationHead: cursor-pagination


📝 Commits (2)

  • 84c9f2b Closes #9599: Add cursor pagination mode
  • 48bff24 Merge branch 'develop' into cursor-pagination

📊 Changes

5 files changed (+298 additions, -6 deletions)

View changed files

📝 docs/integrations/rest-api.md (+22 -1)
📝 netbox/dcim/api/views.py (+3 -2)
📝 netbox/netbox/api/pagination.py (+169 -1)
📝 netbox/netbox/settings.py (+1 -1)
📝 netbox/utilities/tests/test_api.py (+103 -1)

📄 Description

Fixes: #9599

Implemented TwoModePagination to support both Cursor Pagination and Limit Offset Pagination (default). The client can now specify pagination_mode=cursor to use Cursor Pagination. Please see Swagger UI for more information.

  • CursorPaginationWithNoLimit follows OptionalLimitOffsetPagination and allows the client to turn off limit by specifying limit=0. Most of the code is copied from the stock implementation of CursorPagination.
  • When in Cursor Pagination mode, it returns the results in "-create"
    Screen Shot 2022-08-10 at 2 12 49 PM

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/9716 **Author:** [@lyuyangh](https://github.com/lyuyangh) **Created:** 7/13/2022 **Status:** ✅ Merged **Merged:** 10/26/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `9599-cursor-pagination` ← **Head:** `cursor-pagination` --- ### 📝 Commits (2) - [`84c9f2b`](https://github.com/netbox-community/netbox/commit/84c9f2bbdb68615b62f9bf8e1f40e51833d0d222) Closes #9599: Add cursor pagination mode - [`48bff24`](https://github.com/netbox-community/netbox/commit/48bff24da3314276811f1039ac62c2a5af67d09e) Merge branch 'develop' into cursor-pagination ### 📊 Changes **5 files changed** (+298 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/integrations/rest-api.md` (+22 -1) 📝 `netbox/dcim/api/views.py` (+3 -2) 📝 `netbox/netbox/api/pagination.py` (+169 -1) 📝 `netbox/netbox/settings.py` (+1 -1) 📝 `netbox/utilities/tests/test_api.py` (+103 -1) </details> ### 📄 Description ### Fixes: #9599 Implemented `TwoModePagination` to support both [Cursor Pagination](https://www.django-rest-framework.org/api-guide/pagination/#cursorpagination) and Limit Offset Pagination (default). The client can now specify `pagination_mode=cursor` to use Cursor Pagination. Please see Swagger UI for more information. - `CursorPaginationWithNoLimit` follows `OptionalLimitOffsetPagination` and allows the client to turn off limit by specifying `limit=0`. Most of the code is copied from the stock implementation of `CursorPagination`. - When in Cursor Pagination mode, it returns the results in "-create" <img width="718" alt="Screen Shot 2022-08-10 at 2 12 49 PM" src="https://user-images.githubusercontent.com/22896307/183986306-7ed506c7-7361-45b0-abfa-8befb4c8750f.png"> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:19:16 +01:00
adam closed this issue 2025-12-29 23:19:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13508