Answers for "how i send custom data in model field rest_framework serializer"

C
0

how i send custom data in model field rest_framework serializer

class FooSerializer(ModelSerializer):
    foo = serializers.SerializerMethodField()

    def get_foo(self, obj):
        return "Foo id: %i" % obj.pk
Posted by: Guest on September-23-2021

Code answers related to "how i send custom data in model field rest_framework serializer"

Code answers related to "C"

Browse Popular Code Answers by Language