-
-
Notifications
You must be signed in to change notification settings - Fork 247
Added location and floorplan filters to device list API #1169
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
base: master
Are you sure you want to change the base?
Added location and floorplan filters to device list API #1169
Conversation
|
Hey @Srinath0916 thank you for the PR. Looking at this PR there are some issues that need to be resolved. For starters kindly make sure you read Openwisp Contributing Guidelines as QA checks are failing in the CI build. Also it looks like the tests are failing because of missing indoor coordinates. Since you are assigning a floorplan in test_filter_devices_by_floorplan, the DeviceLocation model requires the indoor field to be set. Kindly make sure to run manual tests too before pushing, it would let you know for any inconsistencies. |
|
Hi, thank you for the review, Thank you. |
|
Hi, @stktyagi , thank you for the review, I've added the required indoor field to both device location creations in the test_filter_devices_by_floorplan test. I can see that 12 out of 13 CI checks have passed successfully. The only failing check is Python 3.9 with Django 4.2.0, which appears to be failing due to a dependency issue. |
9dd8f90 to
33185a8
Compare
Checklist
Reference to Existing Issue
Closes #1158.
Description of Changes
Added two new query parameters to the Device list API endpoint:
?location= - filters devices by their associated location
?floorplan= - filters devices by their associated floorplan
The filters work through the DeviceLocation relationship. Added test cases for both filters.
Screenshot