Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django serializer exclude fields

class BLContainerSerializer(serializers.ModelSerializer):
    class Meta:
        model = Container
        exclude = ('field1', )


class BLcontainerMergedSerializer(serializers.ModelSerializer):
    container = BLContainerSerializer()

    class Meta:
        model = BLcontainer
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #serializer #exclude #fields
ADD COMMENT
Topic
Name
4+8 =