[Answer]-How to deal with user_id field properly?

1👍

Try to make the field only required=False instead of Hidden or ReadOnly.

class QuestionSerializer(serializers.ModelSerializer):
    class Meta:
        model = QNAQuestion
        fields = ('id','user','subject', 'body', 'solution')
        extra_kwargs = {
            'user': {'required': False}
        }
👤Todor

Leave a comment