-
Notifications
You must be signed in to change notification settings - Fork 201
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
[feat] add support for dist
parameter on DistanceToPointOrderingFilter
#274
base: master
Are you sure you want to change the base?
[feat] add support for dist
parameter on DistanceToPointOrderingFilter
#274
Conversation
@@ -4,3 +4,5 @@ contexttimer | |||
# QA checks | |||
openwisp-utils[qa]~=0.7.0 | |||
packaging~=20.4 | |||
coreapi==2.3.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coreapi is planned to be deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@auvipy great point, thanks for pointing that out! Do you have suggestions about the best way to handle this?
py==1.11.0 | ||
pycodestyle==2.8.0 | ||
pyparsing==3.0.7 | ||
six==1.16.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why six?
toml==0.10.2 | ||
tox==3.24.5 | ||
virtualenv==20.13.4 | ||
coreapi==2.3.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coreapi is scheduled to be deprecated
d137601
to
f2dc812
Compare
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)