adjust api response querysets
adambreznicky opened this issue · comments
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
might be best to develop this alternative endpoint at /api/v2/