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

Optimize requests to APIv3 #5803

merged 1 commit into from Jun 17, 2019


Copy link

@davidfischer davidfischer commented Jun 13, 2019

Doing if queryset as this does actually evaluates the queryset which can be quite expensive. Rather than doing that, this will just return it. If the project slug is invalid, it should have already 404ed and returning an empty list in the other case seems reasonable. You could see this in the Django Debug Toolbar query tab.

More generally, there is a lot of multi-inheritance in the APIv3 and maybe we could do something to simplify it.

I removed the comment

# NOTE: ``super().get_queryset`` produces the filter by ``NestedViewSetMixin``

In actuality, this method is called by NestedViewSetMixin.get_queryset and not the other way around.

@davidfischer davidfischer requested a review from humitos Jun 13, 2019
@davidfischer davidfischer merged commit fd2c07b into master Jun 17, 2019
2 checks passed
@davidfischer davidfischer deleted the davidfischer/apiv3-skip-expensive-all-query branch Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants