Answers for "django rest framework custom serializer field"

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 "django rest framework custom serializer field"

Code answers related to "C"

Browse Popular Code Answers by Language