[Answered ]-Django serializer returns empty dictionary on create

1👍

I fixed this by replacing it with serializers.ModelSerializer and defining read_only_fields like this:

class CreateCoupleSerializer(serializers.ModelSerializer):

partner_email = serializers.EmailField(write_only=True, max_length=250,
                                       required=True)

class Meta:
    model = Couple
    fields = '__all__'
    read_only_fields = ('user1', 'user2', )

Leave a comment