Skip to content

skip_missing is gone, how to skip None elements ? #229

@touilleMan

Description

@touilleMan

I saw that v2.0.0b removed the skip_missing option, claiming it skips the missing entries by default.
However in my case (using mongoengine's Document) a field is never missing: it returns None which is, strictly speaking, something...

I can see from the commit (a3908d3) that previous behavior of skipping empty values (like None or empty list/tuple) has been obliterated. Is there now a new way to do this ?

I'm thinking for now to overload the _serialize method of each field to check for the empty value and return the missing singleton in such a case... but this sound really cumbersome to me, there must be a better way !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions