Hi! Exactly the same problem, any chance you figured out a good solution 
for it? setup_eager_loading doesn't help in this case at all

On Thursday, July 12, 2018 at 3:54:44 AM UTC-4, Wasp wrote:
>
> I'm using Serializers to transform primary keys into model instances with 
> DRF by using the PrimaryKeyRelatedField. 
> However, when I run the is_valid() method on the serializers to get the 
> validated data for every primary key a query is produced by performing a 
> get on the provided queryset. 
> With large numbers this becomes very inefficient. Is there a way to 
> trigger a .filter() on the queryset or a better way of doing this? I know I 
> can just do a filter on the queryset myself but I like the structured way 
> of doing this via Serializers.
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/99696cc0-3c16-4543-b0d6-e1e342e9ce5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to