Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #send #custom #data #model #field #serializer
ADD COMMENT
Topic
Name
5+3 =