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

Auto optimizations #7

Merged
merged 9 commits into from
Jul 2, 2018
Merged

Auto optimizations #7

merged 9 commits into from
Jul 2, 2018

Conversation

evenicoulddoit
Copy link
Owner

@evenicoulddoit evenicoulddoit commented Apr 16, 2017

TODOS:

  • Rebase / rationalise
  • Add settings to default optimize on/off
  • Document

* Drops Django 1.9, adds Django 1.11
* 1.8 remains due to being LTS
* Drops DRF 3.3, adds DRF 3.6
* Which can be used in place of the explicit mixin approach if desired
* Depending on what is being expanded
* By default is disabled, can easily be enabled globally/per view
* Tested to support optimizing calls to both single related instances,
and to related querysets. Uses `select_related` and `prefetch_related`
as required
* Can be provided explicitly on non-model serializers
* Can be disabled for individual expandable relations
@codecov-io
Copy link

codecov-io commented Apr 17, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@7660bbd). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master       #7   +/-   ##
=========================================
  Coverage          ?   99.77%           
=========================================
  Files             ?        5           
  Lines             ?      450           
  Branches          ?        0           
=========================================
  Hits              ?      449           
  Misses            ?        1           
  Partials          ?        0
Impacted Files Coverage Δ
...est_framework_serializer_extensions/serializers.py 100% <100%> (ø)
rest_framework_serializer_extensions/views.py 98.24% <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 7660bbd...45c4db3. Read the comment docs.

@evenicoulddoit
Copy link
Owner Author

Fixes #6 as an aside

* Remove the requirement to add to `INSTALLED_APPS`, unnecessary
* Better explanation of `QUERY_PARAMS_ENABLED` setting
@evenicoulddoit
Copy link
Owner Author

@gareth-lloyd would love your input on this if you can spare the time? :)

@gareth-lloyd
Copy link
Contributor

I read through this today. I like the approach! I'll try to find time for a line-by-line review and then I'd be happy to start using it on some of our views ASAP.

@jojolalpin
Copy link

Hi,
Anything I can do to help merge the auto optimization ?
CI only fails for django 1.8 and DRF 3.6, but DRF is now at 3.7.7 and oldest supported version of Django is 1.10.

@KyeRussell
Copy link
Contributor

As discussed elsewhere, Django 1.8 support should not be dropped as per Django’s support schedule.

@jojolalpin
Copy link

So maybe make a try with DRF 3.6.4 (last 3.6 version) instead of 3.6.2

@evenicoulddoit
Copy link
Owner Author

@jojolalpin @KyeRussell the tests pass now on this branch, and master has been merged into it, so it conforms to the current Django support lifecycles as well as Rest framework current - 2. The only thing preventing it from being merged is lack of feedback. I could just merge it as-is, as it shouldn't negatively affect users unless they turn the feature on. Happy to take suggestions!

@jojolalpin
Copy link

jojolalpin commented Jan 4, 2018 via email

@jojolalpin
Copy link

Hi, any idea when you merge this ?

@evenicoulddoit
Copy link
Owner Author

Hey @jojolalpin. Sorry, I'm no longer working with DRF so I've not had the ability to run this in the wild. What's your experience been with it? Happy to build a very though I think, because IIRC I've turned the feature off by default?

@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

@evenicoulddoit evenicoulddoit merged commit b66500a into master Jul 2, 2018
@evenicoulddoit evenicoulddoit deleted the auto-optimizations branch July 2, 2018 18:01
@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

@evenicoulddoit
Copy link
Owner Author

@jojolalpin now available in 0.6.0 - thanks for the extreme patience!

@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

@evenicoulddoit
Copy link
Owner Author

I think that's correct, but this was all done so long ago! Would need to sit down properly to give you a more complete answer

@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

@evenicoulddoit
Copy link
Owner Author

Happy to take contributions if you've worked on something?

@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

@jojolalpin
Copy link

jojolalpin commented Jul 2, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants