Write_only_fields has no effect in django rest framework serializer

So far, read_only_fields works flawlessly for me. Only entries only still appear in the GET request even after that →

class UserSerializer(serializers.Serializer):
    class Meta:
        write_only_fields = ('current_password','new_password')

It used to work some time ago in the same code base, but it seems to be broken now.

+4
source share
1 answer

It was removed as announced in 3.2 release notes.

Now you need to use extra_kwargs.

+4
source

Source: https://habr.com/ru/post/1616111/


All Articles