Dynamically change nested field queryset

35 views
Skip to first unread message

Sassan Haradji

unread,
Mar 23, 2018, 6:48:23 PM3/23/18
to Django REST framework
Is it possible to dynamically change queryset of a nested field based on request.user for example? It is possible for PrimaryKeyRelatedField by changing queryset attribute of the field in serializer's __init__, I need the same for a nested field.
I know how to do it with MethodFields, but I want it to be writable.

q391...@qq.com

unread,
Sep 15, 2018, 2:23:10 PM9/15/18
to Django REST framework
Hi, I encountered the same situation, do you know how to deal with it?

在 2018年3月24日星期六 UTC+8上午6:48:23,Sassan Haradji写道:
Reply all
Reply to author
Forward
0 new messages