-
Notifications
You must be signed in to change notification settings - Fork 208
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
Automatically determine select_related
and prefetch_related
on ModelSerializer
#52
Comments
Interesting. I think it should be splitted to two stages:
But I would say it's too magic. For example, in most cases I use serializers in class UserViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = UserSerializer
queryset = queryset.prefetch_related('groups__permissions') |
This may be something that should be in its own third party package, though it would be nice to see it be in drf-extensions.
I wish I could say that most users do this as well, but the Stack Overflow questions keep coming. |
TBH, I understand how |
By and large I think it's too magic. Closing this issue. |
What do you think about adding something along the lines of encode/django-rest-framework#1964 to drf-extensions?
@thedrow offers a pretty good write-up on a workable approach: encode/django-rest-framework#1964 (comment)
The text was updated successfully, but these errors were encountered: