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

Use PreloadIncludesMixin for ReadOnlyModelViewSet #946

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

Merged
sliverc merged 2 commits into django-json-api:master from anehx:patch-1
May 28, 2021

Conversation

Copy link
Contributor

@anehx anehx commented May 25, 2021
edited
Loading

Description of the Change

This allows the usage of select_for_includes and prefetch_for_includes on ReadOnlyModelViewSet

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test (削除) added (削除ここまで) updated
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

Copy link

codecov bot commented May 25, 2021
edited
Loading

Codecov Report

Merging #946 (65d41f7) into master (2eea772) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@
## master #946 +/- ##
==========================================
+ Coverage 97.69% 97.70% +0.01% 
==========================================
 Files 58 59 +1 
 Lines 3120 3134 +14 
==========================================
+ Hits 3048 3062 +14 
 Misses 72 72 
Impacted Files Coverage Δ
example/migrations/0009_labresults_author.py 100.00% <100.00%> (ø)
example/tests/test_performance.py 100.00% <100.00%> (ø)
example/urls_test.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eea772...65d41f7. Read the comment docs.

@sliverc sliverc self-requested a review May 25, 2021 17:13
Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

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

hi @anehx it has been a while since I reviewed one of your PRs 😄

Nice catch with this fix. Thanks. It seems that is a regression of PR #600 so since version 2.8.0. I have added checklist into your PR description to see what is missing.

As this is a regression it is actually important to add a test so this is not happening again.

Have a look at #600 where there is a test example which I guess can be done on a ReadOnlyViewSet as well. Also add yourself to AUTHORS if not done yet and add a changelog entry. Thanks.

This allows the usage of `select_for_includes` and `prefetch_for_includes` on `ReadOnlyModelViewSet`
Copy link
Member

@sliverc sliverc left a comment

Choose a reason for hiding this comment

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

Thanks a lot. LGTM.

@sliverc sliverc changed the title (削除) fix(perf): use preload includes mixin for read only model view set (削除ここまで) (追記) Use PreloadIncludesMixin for ReadOnlyModelViewSet (追記ここまで) May 28, 2021
@sliverc sliverc merged commit 858119e into django-json-api:master May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@sliverc sliverc sliverc 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.

2 participants

AltStyle によって変換されたページ (->オリジナル) /