Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

fields.Pluck does not work as expected #158

Open
vaibhavmano opened this issue Feb 25, 2021 · 0 comments
Open

fields.Pluck does not work as expected #158

vaibhavmano opened this issue Feb 25, 2021 · 0 comments

Comments

@vaibhavmano
Copy link

Code

class LSerializer(Schema):
    id = fields.Integer()
    last_name = fields.String()
    first_name = fields.String()

class RSerializer(Schema):
    id = fields.Integer()
    last_name = fields.Pluck(LSerializer, 'last_name')
    first_name = fields.Pluck(LSerializer, 'first_name')
    occupation = fields.String()

Response

{
    "id": 1
    "occupation": "Student"
}

Expected Response

{
    "id": 1,
    "first_name": "John",
    "last_name": "Appleseed",
    "occupation": "Student"
}

Pluck does not seem to work as expected or I'm not sure if I'm missing anything!

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

No branches or pull requests

1 participant