Django REST framework

Saving foreign key ID with Django REST framework serializer

16 Feb 2018, 04:11 PM
If you are using Django REST framework on serving your APIs, you probably did the below code in returning the related object in your serializer. class MyTableSerializer(serializers.ModelSerializer): user = UserSerializer(many=False, read_only=True) class Meta: fields = '__all__' model = MyTable But...