Skip to content

Take default value when value is None #1766

@dormeiri

Description

@dormeiri

I would like to specify fields that will use the default value if their value is None (even if they are not missing), something similar to the following field declaration will match perfectly to my case:

fields.Pluck(MySchema, 'x', default={'x': 0}, take_default_on=[None])

Is there any way doing this without @post_dump or overriding get_attribute method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions