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

[feat] add support for dist parameter on DistanceToPointOrderingFilter #274

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

carolinekessler
Copy link

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)

@auvipy auvipy self-requested a review April 4, 2022 10:44
@@ -4,3 +4,5 @@ contexttimer
# QA checks
openwisp-utils[qa]~=0.7.0
packaging~=20.4
coreapi==2.3.3
Copy link
Collaborator

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

Copy link
Author

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
Copy link
Collaborator

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
Copy link
Collaborator

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

@nemesifier nemesifier force-pushed the master branch 2 times, most recently from d137601 to f2dc812 Compare May 9, 2022 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants