Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field selection not working with SerializerMethodField #39

Open
roberto-ayala opened this issue Jan 30, 2023 · 0 comments
Open

field selection not working with SerializerMethodField #39

roberto-ayala opened this issue Jan 30, 2023 · 0 comments

Comments

@roberto-ayala
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant