Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add relationships support for pointers in errors#986

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sliverc merged 4 commits intodjango-json-api:masterfrommehdy:master
Oct 7, 2021

Conversation

mehdy
Copy link
Contributor

@mehdymehdy commentedOct 3, 2021
edited
Loading

Fixes#413

Description of the Change

When formatting DRF errors, userelationships in the pointer when the field is actually a relationship.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name inAUTHORS

@mehdy
Copy link
ContributorAuthor

@sliverc This is my draft attempt at solving the problem. I was wondering if you could give me some hints on whether I'm headed in the right direction or not?

@codecov
Copy link

codecovbot commentedOct 3, 2021
edited
Loading

Codecov Report

Merging#986 (24de3fa) intomaster (0816192) willincrease coverage by0.01%.
The diff coverage is100.00%.

Impacted file tree graph

@@            Coverage Diff             @@##           master     #986      +/-   ##==========================================+ Coverage   96.83%   96.84%   +0.01%==========================================  Files          65       65                Lines        3914     3929      +15     ==========================================+ Hits         3790     3805      +15  Misses        124      124
Impacted FilesCoverage Δ
example/tests/snapshots/snap_test_errors.py100.00% <100.00%> (ø)
example/tests/test_errors.py100.00% <100.00%> (ø)
rest_framework_json_api/renderers.py90.15% <100.00%> (ø)
example/utils.py92.67% <0.00%> (+0.30%)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update0816192...24de3fa. Read thecomment docs.

@sliverc
Copy link
Member

Yes you are on the right track.included_serializers is optional though so not the right way to determine whether a field is a relationship. Seehere how an attribute is distinguished from relationship in the renderer.

@mehdy
Copy link
ContributorAuthor

@sliverc Great! Thanks!

@mehdymehdy changed the titleWIP: Add relationships support for pointers in errorsAdd relationships support for pointers in errorsOct 3, 2021
@mehdy
Copy link
ContributorAuthor

@sliverc
I think this is ready for review.
Just let me know if I should add it toCHANGELOG.md and/or the docs.

@mehdy
Copy link
ContributorAuthor

@sliverc I couldn't understand whycodecov is failing. Should I do something?

Copy link
Member

@slivercsliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for working on this. Please see my inline comments.

mehdy reacted with thumbs up emoji
@mehdy
Copy link
ContributorAuthor

@sliverc Resolved all the issues you mentioned.

Copy link
Member

@slivercsliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This PR is shaping up nicely. See some small comments inline.

mehdy reacted with hooray emoji
@mehdy
Copy link
ContributorAuthor

@sliverc Done as well. Thanks for the tips.

Copy link
Member

@slivercsliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the changes. Somewhat one of my comment got swallowed (maybe had to many tabs open... 😄 ) See last comment, also rebase to current master and then this PR is good to merge.

@sliverc
Copy link
Member

and totally forgot please also add a changelog entry.

mehdy reacted with thumbs up emoji

Signed-off-by: Mehdy Khoshnoody <mehdy.khoshnoody@gmail.com>
Signed-off-by: Mehdy Khoshnoody <mehdy.khoshnoody@gmail.com>
Signed-off-by: Mehdy Khoshnoody <mehdy.khoshnoody@gmail.com>
@mehdy
Copy link
ContributorAuthor

@sliverc I think we're good to go :D

Signed-off-by: Mehdy Khoshnoody <mehdy.khoshnoody@gmail.com>
Copy link
Member

@slivercsliverc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the changes and your time putting into making this work. Very appreciated.

It seems that you (your IDE?) autoformatted the changelog markdown file (I guess with prettier?). There were quite a few changes... I reverted those to make this PR ready. But certainly something to think about whether as DJA we want to autoformat md files but I guess part of another discussion.

Thanks again.

@slivercsliverc merged commitee679ee intodjango-json-api:masterOct 7, 2021
@mehdy
Copy link
ContributorAuthor

@sliverc You're very welcome!
Sorry about the autoformat. Thanks for taking care of it though. :D

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@slivercslivercsliverc approved these changes

@auvipyauvipyauvipy approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Error pointer always refers to the attributes
3 participants
@mehdy@sliverc@auvipy

[8]ページ先頭

©2009-2025 Movatter.jp