-
Notifications
You must be signed in to change notification settings - Fork 165
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
Support For DRF 3.15 nested SimpleRouter.use_regex_path = False #355
Conversation
@alanjds would it be possible to get this merged in? |
Thanks @davidjayb for the ping. This PR is good and totally got out of my radar. That said, why is the DRF 3.14 support being dropped on CI? I say that because usually I like to keep support at least for the latest-1 version of stuff. |
During conflict solving, I updated the tox file to test with DRF 3.14 and 3.15, and they both passed. So I am merging the update and will release a version after some days with this running just on Again, thanks @Gibsondz a lot for the contribution and @davidjayb for the heads up. |
Hey @alanjds thanks for getting this pushed through, was a nice surprise. It was a while ago, but I believe I may have preemptively removed 3.14 from the CI because I thought it would potentially fail when running the new test_non_regex_recursive_nested_simple_router test due to the passed use_regex_path kwarg. However it seems that is not the case so thanks for reverting that. Cheers! |
Just came across this PR while running into use_regex_path issues — seems like parent path segments are getting dropped from my nested routes 😵💫. Would really appreciate it if a release could be tagged so I can check if this fixes my issue 🙏 |
Hi @stevelacey. In meantime I suggest you to install from From a long time I do need to flex my muscle and learn how to issue dev/beta/preview releases on PyPI, yet I had not bitten this bullet so far. |
Fair enough 🙃 Installing from master seems to have solved my problems, thanks! 👍 |
This PR is to address the following issue:
#342
In order to properly use use_regex_path=False for the simple router you must have DRF 3.15+. If the kwarg is passed and an earlier version of DRF is used it should simply TypeError due to the unexpected kwarg . If this requires a read-me update for notes around Requirements & Compatibility let me know what you would like to see there and I can add it.
The changes are the same as suggested in #342 and are explained in more detail there. The changes are essentially changing how we pre-pend the parent url when use_regex_path=False, allowing it to correctly nest the routes. I also added a unit test validating the changes.
Please let me know if you have any concerns or questions!