Skip to content
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

adjust api response querysets #14

Open
adambreznicky opened this issue Aug 13, 2019 · 1 comment
Open

adjust api response querysets #14

adambreznicky opened this issue Aug 13, 2019 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@adambreznicky
Copy link

currently, almost all api viewsets overwrite the get_queryset() method to always apply public=True, convert null/none values to the proper 'None' python format, and order the query results in a standard way.

maybe these get_queryset methods should be removed and, instead, use the more standard queryset=model object query. then we can/should add the standard orderingfilter & serarchfilter to each viewset via their filter_backends property.
currently, api responses are hard coded in the order which the viewset designates. making these changes would open up the user's (and our frontends) ability to sort the response from their request url and simplify the code.

https://www.django-rest-framework.org/api-guide/filtering/#orderingfilter
https://www.django-rest-framework.org/api-guide/filtering/#searchfilter

@adambreznicky adambreznicky added bug Something isn't working enhancement New feature or request labels Aug 13, 2019
@adambreznicky
Copy link
Author

might be best to develop this alternative endpoint at /api/v2/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant