Skip to content

field selection not working with SerializerMethodField #39

@roberto-ayala

Description

@roberto-ayala
class ServiceSerializer(DynamicFieldsMixin, serializers.ModelSerializer):

    stretch = serializers.SerializerMethodField()

    class Meta:
        model = Service
        fields = ['id', 'stretch', 'name']

    def get_stretch(self, obj):
         ...

I can't skip the stretch field or select the others, it always shows me all the fields, is there any way to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions