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
merged 1 commit into from
Jun 17, 2019

Conversation

davidfischer
Copy link
Contributor

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 June 13, 2019 22:57
@davidfischer davidfischer merged commit fd2c07b into master Jun 17, 2019
@davidfischer davidfischer deleted the davidfischer/apiv3-skip-expensive-all-query branch June 17, 2019 16:52
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.

2 participants