Answers for "rest framework serializer fields"

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 "rest framework serializer fields"

Code answers related to "C"

Browse Popular Code Answers by Language