Skip to content

OneOfSchema can't use pre/post_dump/load decorators #4

@lafrech

Description

@lafrech
class MyUberSchema(OneOfSchema):
    type_schemas = {
        'foo': FooSchema,
        'bar': BarSchema,
    }

    @post_load
    def whatever(self, data):
        print("post load")

AFAIU, post_load decorated method is never called. It may be intended, or it may not be an issue, but while trying to do that it failed and I didn't see this documented so I don't know if this is known.

To get this to work, the post_load method needs to be defined in FooSchema and BarSchema (or a common parent).

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