Added location and floorplan filters to device list API
Checklist
- [x ] I have read the OpenWISP Contributing Guidelines.
- [ x] I have manually tested the changes proposed in this pull request.
- [ x] I have written new test cases for new code and/or updated existing tests for changes to existing code.
- [ ] I have updated the documentation.
Reference to Existing Issue
Closes #1158.
Description of Changes Added two new query parameters to the Device list API endpoint:
?location=
Screenshot
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,
I've added the required indoor field to both device location creations in the test_filter_devices_by_floorplan test.
Could you please check if this resolves the issue? Let me know if there's anything else that needs to be fixed.
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. This seems to be unrelated to my changes since all other Python versions (3.10, 3.11, 3.12, 3.13) are passing. Could you please let me know if this is a known issue or if there's anything I should do on my end? Looking forward for your feedback on this so i can work on it. Thank you.
Hi @stktyagi , PR #1174 has been merged which drops Python 3.9 support. Could you re-run the checks on this PR? All tests should pass now. Thanks!
coverage: 98.608% (+0.001%) from 98.607% when pulling 33185a8a7e9b1d73daf1458f1219ab934ba25419 on Srinath0916:issues/device-location-floorplan-filter into aa2561fc452cd91a96b416bfeb565bc7a029fb38 on openwisp:master.
Hi @pandafy , @stktyagi , all checks are passing now, This PR is ready for review.