-
Notifications
You must be signed in to change notification settings - Fork 301
Properly support formatting of link segments in related urls #897
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
Properly support formatting of link segments in related urls #897
Conversation
Codecov Report
@@ Coverage Diff @@
## master #897 +/- ##
=======================================
Coverage 97.67% 97.68%
=======================================
Files 58 58
Lines 3102 3115 +13
=======================================
+ Hits 3030 3043 +13
Misses 72 72
Continue to review full report at Codecov.
|
I am a bit confused by the title but is this change not just adding support of formatting links to RelationshipView? As When looking at your changes in this PR it occurred to me that we introduced a backwards incompatible change in #876 which we introduce again in this PR as well. Imagine someone uses camel cased naming for fields in their serializer. After this change in this PR suddenly it would not find the field anymore as it is looking for a field with underscore naming even though they did not configure In terms of tests a integration test would work best like one of those |
Only converting to underscore when the setting is enabled makes sense. Thanks for the guidance on the test. As for RelatedMixin vs RelationshipView, probably just a mistype on my part, but I do want to emphasize that both Thanks for the initial review. |
In #909 the issue has been addressed that field names are preserved when no formatting has been configured. @platinumazure Do you think you will find time to continue working on this PR? |
@sliverc Hard to say, I've been super busy lately. Sorry. |
23c254b
to
2a251b7
Compare
I had a quick look into this and updated the PR. To note is that for the formatted url to work dashes also need to be matched by the url pattern like the following:
The documentation before only stated |
Thank you so much @sliverc for finishing this up! |
Description of the Change
Add logic to RelatedMixin (related views) and RelationshipView (relationship views) to make sure related field kwarg is properly converted to underscore format.
I don't have a test yet. Would appreciate some guidance on how to proceed. Basically I need to test the view action and make sure the related serializer is found based on the underscore-converted kwarg.
Checklist
CHANGELOG.md
updated (only for user relevant changes)AUTHORS