Skip to content
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

[RFC] admin: prefetch related fields #366

Merged
merged 2 commits into from Oct 25, 2017
Merged

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Sep 20, 2017

This only does it for the customer's changelist view now, but it meant
to be generic enough for other admins.

You can easily see the number of queries going down when using django-debug-toolbar or something similar.

TODO:

  • tests
@blueyed blueyed changed the title admin: prefetch related fields [RFC/WIP] admin: prefetch related fields Sep 20, 2017
@blueyed blueyed force-pushed the blueyed:admin-prefetch branch from 1ed4168 to 1972feb Sep 20, 2017
@paltman
Copy link
Member

@paltman paltman commented Sep 21, 2017

I'm a 👍 on this. Can you please use double-quotes is all that I ask, please?

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Sep 21, 2017

double-quotes

Sure. At least you do not have two-space indendation.. ;)

I have some stashed tests to test the number of queries in existing tests - will update.

@blueyed blueyed force-pushed the blueyed:admin-prefetch branch from 25f77aa to a567f03 Sep 28, 2017
@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Sep 28, 2017

Tests have been added - but there might be a better way.

@blueyed blueyed changed the title [RFC/WIP] admin: prefetch related fields [RFC] admin: prefetch related fields Sep 28, 2017
@blueyed blueyed force-pushed the blueyed:admin-prefetch branch from a567f03 to 353d300 Oct 2, 2017
@blueyed blueyed force-pushed the blueyed:admin-prefetch branch from 2e0e23b to 96aae71 Oct 17, 2017
@blueyed blueyed force-pushed the blueyed:admin-prefetch branch from 96aae71 to 30f7dcb Oct 17, 2017
@codecov
Copy link

@codecov codecov bot commented Oct 17, 2017

Codecov Report

Merging #366 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #366      +/-   ##
=========================================
+ Coverage   99.39%   99.4%   +<.01%     
=========================================
  Files          34      34              
  Lines        1662    1676      +14     
  Branches      135     138       +3     
=========================================
+ Hits         1652    1666      +14     
  Misses          5       5              
  Partials        5       5
Flag Coverage Δ
#py27dj110 99.4% <100%> (ø) ⬆️
#py27dj111 99.4% <100%> (ø) ⬆️
#py27dj18 99.4% <100%> (ø) ⬆️
#py34dj110 99.4% <100%> (ø) ⬆️
#py34dj111 99.4% <100%> (ø) ⬆️
#py34dj18 99.4% <100%> (ø) ⬆️
#py34dj20 99.4% <100%> (ø) ⬆️
#py35dj110 99.4% <100%> (ø) ⬆️
#py35dj111 99.4% <100%> (ø) ⬆️
#py35dj18 99.4% <100%> (ø) ⬆️
#py35dj20 99.4% <100%> (ø) ⬆️
#py36dj111 99.4% <100%> (ø) ⬆️
#py36dj20 99.4% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pinax/stripe/admin.py 100% <100%> (ø) ⬆️

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 6a1f3b8...fa8c35c. Read the comment docs.

@blueyed
Copy link
Contributor Author

@blueyed blueyed commented Oct 17, 2017

Would like some feedback on the tests.
@ticosax @paltman @lukeburden

@paltman paltman added this to the Samwise milestone Oct 20, 2017
@paltman paltman merged commit 1d9035c into pinax:master Oct 25, 2017
16 checks passed
16 checks passed
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: py27dj110 Your tests passed on CircleCI!
Details
ci/circleci: py27dj111 Your tests passed on CircleCI!
Details
ci/circleci: py27dj18 Your tests passed on CircleCI!
Details
ci/circleci: py34dj110 Your tests passed on CircleCI!
Details
ci/circleci: py34dj111 Your tests passed on CircleCI!
Details
ci/circleci: py34dj18 Your tests passed on CircleCI!
Details
ci/circleci: py34dj20 Your tests passed on CircleCI!
Details
ci/circleci: py35dj110 Your tests passed on CircleCI!
Details
ci/circleci: py35dj111 Your tests passed on CircleCI!
Details
ci/circleci: py35dj18 Your tests passed on CircleCI!
Details
ci/circleci: py35dj20 Your tests passed on CircleCI!
Details
ci/circleci: py36dj111 Your tests passed on CircleCI!
Details
ci/circleci: py36dj20 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 99.39%)
Details
codecov/project 99.4% (+<.01%) compared to 6a1f3b8
Details
@blueyed blueyed deleted the blueyed:admin-prefetch branch Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.