Skip to content
New issue

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

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

Already on GitHub? # to your account

Enable sorting REST API results #8995

Closed
jeremystretch opened this issue Mar 29, 2022 · 0 comments
Closed

Enable sorting REST API results #8995

jeremystretch opened this issue Mar 29, 2022 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Milestone

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Mar 29, 2022

NetBox version

v3.1.10

Feature type

New functionality

Proposed functionality

Allow users to specify a field by which the results of a REST API query should be ordered. For example:

GET /api/dcim/sites/?ordering=tenant

This seems easily feasible by adding DRF's built-in OrderingFilter to DEFAULT_FILTER_BACKENDS. We'll also need to define ordering_fields on each API view set.

Edit: This was first proposed in #3650.

Use case

Allows for more efficiently retrieving a set of objects in a particular order via the REST API.

Database changes

No response

External dependencies

No response

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Mar 29, 2022
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Apr 7, 2022
@jeremystretch jeremystretch added this to the v3.3 milestone Apr 7, 2022
@jeremystretch jeremystretch self-assigned this Apr 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 8, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

1 participant