The DistanceToPointOrderingFilter inherits from the DistanceToPointFilter but only supports the point param and no dist param. This adds support for the dist param (such that a user can query for all points within a certain dist of the given point and have the results returned in asc or desc order) by combining the filter_queryset logic of the existing DistanceToPointOrderingFilter#filter_queryset and the DistanceToPointFilter#filter_queryset.
This also implements a get_schema_fields() method so the filter fields can be included in schema autogeneration provided by the Django REST framework (documentation linked)
The
DistanceToPointOrderingFilter
inherits from theDistanceToPointFilter
but only supports thepoint
param and nodist
param. This adds support for thedist
param (such that a user can query for all points within a certaindist
of the givenpoint
and have the results returned inasc
ordesc
order) by combining thefilter_queryset
logic of the existingDistanceToPointOrderingFilter#filter_queryset
and theDistanceToPointFilter#filter_queryset
.This also implements a
get_schema_fields()
method so the filter fields can be included in schema autogeneration provided by the Django REST framework (documentation linked)