Closed 3lf closed 3 years ago
I found it after hours read code :|
just need add
,context={'request': request,}
to serializer
for example:
change
InputCartSerializer(obj).data
to
InputCartSerializer(obj,context={'request': request,}).data
I found it after hours read code :| just need add
,context={'request': request,}
to serializerfor example: change
InputCartSerializer(obj).data
toInputCartSerializer(obj,context={'request': request,}).data
Yes DynamicFieldsMixin
needs request to work cuz that's where it gets the query
, so passing request to the context is all you need in your serializer.
how can I use django-restql in api_view? for example: