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}
}
Source:stackexchange.com